What a disappointment! Ionic has become the Java of mobile development

Yes, friends, this is increasingly proving true.
Today, setting up an Ionic development environment is as annoying and cumbersome as setting up a Java environment for web.

Believe me, if I have the latest versions of Cordova, Ionic and Node.js, nothing will work as planned!
Obviously a raw Ionic app works. But try to start adding some plugins that are officially listed in Ionic’s own documentation, and … BOOM! The errors of library incompatibilities begin. Where else have we seen this? In Java …

Believe me, just a few plugins, to find out that you can only install if you change the version of Node.js to X.X.X, and the version of NPM has to be Y.Y.Y not to mention that its latest version of Ionic CLI is not, Which use the lower Z.Z.Z.

Wow, this is giving me so much headache that I’m almost giving up the Ionic app!

Currently my environment setting is:

cli packages: (/home/walter/workspace/0-javascript/0-ionic/dieta-fit-v2/node_modules)

    @ionic/cli-plugin-cordova       : 1.6.2
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts : 1.3.7
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.4.2

System:

    Android SDK Tools : 26.0.2
    Node              : v7.10.1
    OS                : Linux 4.10
    npm               : 5.3.0 

And All I wanted was to be able to use some plugins like LocalNotifications, this one, by the way, do not install or pray to Jesus Christ!

Please give me a light, which would be the ideal environment setting so that I can only install this and other plugins!

Remembering that I always try to follow Ionic’s official documentation to the fullest and I always use Ionic CLI to add and remove platforms and plugins:

$ ionic cordova plugin add some-plugin

If you just want to whine, then fine, but if you actually want advice and assistance, please provide concrete information instead of vague meaningless nonsense about X and Y and Z. What exact commands are you running and what exact errors do you get?

1 Like

There were breaking changes introduced from 3.4.2 to 3.5, so you might be running into that. But that only affects routing I think, so if you aren’t playing with routing or deep links, that probably doesn’t touch you. (Actually, maybe the plugins use it under the hood. So yeah, if you’re using CLI 3.7, best to update your framework.)

Dear friend, you do not have to bluntly respond to legitimate frustration.

I developed with Ionic 2 years ago and before these new versions had never had problems like this.

So calm down.

Well, I am addressing this problem:

$ ionic cordova plugin add de.appplant.cordova.plugin.local-notification

> cordova plugin add de.appplant.cordova.plugin.local-notification --save
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.
        
[ERROR] An error occurred while running cordova plugin add de.appplant.cordova.plugin.local-notification --save (exit
        code 1):
        
        Installing "de.appplant.cordova.plugin.local-notification" for android
        Plugin dependency "cordova-plugin-device@1.1.4" already fetched, using that version.
        Dependent plugin "cordova-plugin-device" already installed on android.
        Failed to install 'de.appplant.cordova.plugin.local-notification': Error
        at /home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:205:33
        at _rejected
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:864:24)
        at /home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:890:30
        at Promise.when
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:1142:31)
        at Promise.promise.promiseDispatch
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:808:41)
        at /home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:624:44
        at runSingle
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:137:13)
        at flush
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:125:13)
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9)
        Error: Failed to fetch plugin cordova-plugin-app-event via registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.
        Failed to get absolute path to installed module

My friend, I’m really not dealing with routing or with deep links, and moreover, errors occur when I execute the command to add plugins via ionic cordova plugin add and when adding ionicNative packages that accompany these plugins via NPM with npm install - -save @ionic-native/some-plugin

The errors are not running the app or debugging.

I think you have a problem with your network environment, because I just ran the ionic cordova plugin add de.appplant.cordova.plugin.local-notification command and it worked fine.

Thank you for your prompt response. really.

Well, then my network connection just does not like this plugin, because other things I can install normally.

I even use a lot of resources coming from github, and I even tried to install this plugin from its official github repository, and none of that solved it.

$ ionic cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications

For me, the main problem is in this line of error when trying to install the plugin:

ELOOP: too many symbolic links encountered, access

This excess of symbolic links.

Many answers on the internet talk about this problem but without giving a solution that is not regressed for Node.js 6.x and NPM 3.6.x

See the very end of this thread, and check your lock file.

Unfortunately it did not work for me.

You could try switching to the latest LTS version of Node. I generally find that more reliable than using bleeding edge versions of npm. More ideas in here. If you’re not already using it, I highly recommend nvm for managing node/npm installations. Allows easy installation of multiple versions, switching and cleanup.

2 Likes

Unfortunately I can not use Lode Node.js as this is version 6.x. With it I can not even run the Ionic command, because the node-sass required by Ionic only runs above version 7 of the Node.s

I made another attempt.

I have the latest versions of Cordova, NPM and Ionic CLI installed.

I’ve created a new blank ionic app:

$ Ionic start local-notification blank --cordova

I added the android platforms and ios:

$ Ionic cordova platform add ios android

And finally I added the plugin:

$ Ionic cordova plugin add de.appplant.cordova.plugin.local-notification

And I received the same error:

> cordova plugin add de.appplant.cordova.plugin.local-notification --save
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.
        
[ERROR] An error occurred while running cordova plugin add de.appplant.cordova.plugin.local-notification --save (exit
        code 1):
        
        Installing "de.appplant.cordova.plugin.local-notification" for android
        Plugin dependency "cordova-plugin-device@1.1.4" already fetched, using that version.
        Dependent plugin "cordova-plugin-device" already installed on android.
        Failed to install 'de.appplant.cordova.plugin.local-notification': Error
        at /home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:205:33
        at _rejected
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:864:24)
        at /home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:890:30
        at Promise.when
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:1142:31)
        at Promise.promise.promiseDispatch
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:808:41)
        at /home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:624:44
        at runSingle
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:137:13)
        at flush
        (/home/walter/.npm-global/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:125:13)
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9)
        Error: Failed to fetch plugin cordova-plugin-app-event via registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.
        Failed to get absolute path to installed module

We need to help them financially. Ionic is truly the best thing that happend to mobile dev.

"You can’t use Cordova plugins that haven’t made the necessary changes for Cordova 7.

Go without the plugins you’re trying to install or go back to Cordova 6."

It finally Works for me. But a need to recriate ALL the app bicose this has have been created with latest cordova.

=\

Good advice @rapropos.
I can confirm that, while I don’t have these specific problems, LTS Node has been a requirement for me across the board.

1 Like

That’s news to me.

$ ionic info
cli packages:

    @ionic/cli-utils  : 1.6.0 (project/node_modules/ionic/node_modules/@ionic/cli-utils)
    ionic (Ionic CLI) : 3.6.0 (project/node_modules/ionic)

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts              : 2.0.2
    @ionic/cli-plugin-cordova       : 1.4.1
    @ionic/cli-plugin-ionic-angular : 1.3.2
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.6.0

System:

    Android SDK Tools : 26.0.2
    Node              : v6.11.1
    OS                : Linux 4.9
    npm               : 3.10.10 
1 Like

At first I also found it strange. So I downgraded to version 6 of my global installation of Cordova, I created a new ionic app with $ ionic start, I added the platforms, and finally I tried to install the plugin, and yes, it worked!

But before accepting the downgrade of the cordova as absolute truth, I will try to replicate your environment here to be sure.

The only problem is the erratic mansion that I get when using the $ ionic serve informing of the incompatibility of the node-sass with the version of node.js lower than 7.x

Something occurred to me here now …
Would it be possible to create environments with node.js, cordova and ionic-cli in Docker to test various environment options?

Just to jump in:

All the issues described have nothing to do with Ionic Framework itself, but the greater ecosystem of Cordova, NPM and Javascript in general - and Java! Because of course Cordova is using Java to create Android projects.

What you are experiencing specifically are problems with Cordova 7 (that is slowly switching over to NPM instead of their home grown dependency management and distribution system) and probably also with NPM itself, that recently made a major version upgrade that changed some things.