cordova-plugin-local-notifications: Error: Failed to fetch plugin de.appplant.cordova.plugin.local-notification

Unable to install $ ionic cordova plugin add de.appplant.cordova.plugin.local-notification as described on Ionic’s website: http://ionicframework.com/docs/native/local-notifications/

I get the following:

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):

    Error: Failed to fetch plugin
    de.appplant.cordova.plugin.local-notification@^0.8.5 via registry.
    Probably this is either a connection problem, or plugin spec is
    incorrect.
    Check your connection and plugin name/version/URL.
    Error: npm: Command failed with exit code 194 Error output:
    npm ERR! path
    /Users/laroca/Documents/demo/node_modules/cordova-plugin-app-event/package.json
    npm ERR! code ELOOP
    npm ERR! errno -62
    npm ERR! syscall open
    npm ERR! ELOOP: too many symbolic links encountered, open

Your Environment

  • Plugin version:

  • Platform: Ionic Framework crossplatform env.

  • OS version: Latest MAC O.S.

  • Device manufacturer / model: n/a…just trying to install the plugin.

  • Cordova version (cordova -v):

  • Cordova platform version (cordova platform ls):
    “cordova-android”: “^6.2.3”,

  • Plugin config

  • Ionic Version (if using Ionic) 2.0

Expected Behavior

Tell us what should happen

Actual Behavior

Tell us what happens instead

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

Context

What were you trying to do?

Debug logs

Include iOS / Android logs

  • ios XCode logs
  • Android: $ adb logcat

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 21 (1 by maintainers)

Most upvoted comments

This problem is probably because you use cordova 7. Try use the --nofetch option to get the previous behaviour of the cordova.

cordova plugin add {plugin-name} --nofetch

The cordova 7 uses the npm to install the plugins, and probably your npm is not globally installed, or misconfigured.

2017-07-23 11:17 GMT+02:00 Alexandru Robert notifications@github.com:

Same here.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/1345#issuecomment-317239905, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQrULRifSQwlk-3aHMx2ZwDy24rIUdpks5sQw-lgaJpZM4OTkNS .

I had the same error. macOS: 10.12.6 node: 8.3.0 npm: 5.3.0 cordova: 7.0.1 ionic v1 (but I don’t think this is a problem)

Now it’s working but I had to “clean” my project first:

  • remove platforms android and ios (ionic cordova platform rm)
  • remove plugins: cordova-plugin-device, cordova-plugin-app-event, de.appplant.cordova.plugin.local-notification (through cordova plugin rm, npm rm or manually in the nodes_modules and package.json)
  • install separately: cordova-plugin-device, cordova-plugin-app-event, de.appplant.cordova.plugin.local-notification (ionic cordova plugin add)
  • install platforms (ionic cordova platform add)

I hope this will work for you too

I have the same problem. I’m on macOS.

node -v v8.2.1

npm -v 5.3.0

cordova -v 7.0.1

P.S. cordova plugin add {plugin-name} --nofetch

works for me. however, there will be a
“cordova-plugin-app-event”: “file:node_modules/cordova-plugin-app-event”, in package.json, which always causes problems on new machines.

Here’s what worked for me. I had an empty cordova-plugin-app-event file in my node_modules directory. I deleted that then also removed its reference in package.json. Then ran ionic cordova plugin add de.appplant.cordova.plugin.local-notification --nofetch.

After many days of pain I finally got the answer to my problems here: https://github.com/katzer/cordova-plugin-local-notifications/issues/1329 . @sxagan said the following: “I looked into node_modules and there is a file/symlink of the plugin i wanted to install. once i removed that, i have no problem installing the plugin.” True enough, every time I checked out a pre-plugin installation of the app and proceeded to install cordova-plugin-local-notifications, I would notice a file (instead of the usual folders) in my node_modules. I removed the file and once again ran cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications and the plugin would install succesfully.

Use the --nofetch flag when adding the plugin.

If using --nofetch didn’t work for you, just check that you haven’t run the command using sudo.

@stevesum fixed it using a HTML5 way 😦