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

Created on 11 Jul 2017  Â·  21Comments  Â·  Source: katzer/cordova-plugin-local-notifications

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_

  1. ...
  2. ...
  3. ...
  4. ....

Context

_What were you trying to do?_

Debug logs

_Include iOS / Android logs_

  • ios XCode logs
  • Android: $ adb logcat

Most helpful comment

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
.

All 21 comments

Seems to be related to the npm version used, see: https://github.com/katzer/cordova-plugin-local-notifications/issues/1329

same problem

Same here.

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
.

@stevesum - I've got npm globally installed, and npm's been working fine on my windows machine, but on my mac it fails with this issue.

Would you be able to enlighten me on what the misconfiguration with npm@5 and cordova@7 are, so that I can look to try and correct them?

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.

same here.
Hope it will be fixed soon. Thanks

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

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.

Tried to install by Github link but didn't work either

if you use cordova 7.x then install it with nofetch property as they
suggest in the documentation.

cordova plugin add .... --nofetch
https://cordova.apache.org/news/2017/05/04/cordova-7.html

2017-09-24 13:40 GMT+02:00 Daniel notifications@github.com:

Tried to install by Github link but didn't work either

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/katzer/cordova-plugin-local-notifications/issues/1345#issuecomment-331704323,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACQrUHifqLnO9diXRCXJXEfSOV-PSw87ks5slj-YgaJpZM4OTkNS
.

@stevesum fixed it using a HTML5 way :(

remove the following file (symlink): node_modules/cordova-plugin-device for every build.

Use the --nofetch flag when adding the plugin.

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.

Facing same eoor :-

cordova plugin add http://github.com/apache/cordova-plugins.git#master:wkwebview-engine-localhost --save --nofetch
support for subdirectories is deprecated and will be removed in Cordova@7

Fetching plugin "https://github.com/apache/cordova-plugins.git" via git clone
Error: Failed to fetch plugin http://github.com/apache/cordova-plugins.git via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: C:\Program Files\Git\cmd\git.exe: Command failed with exit code 128 Error output:
Cloning into 'D:\Users\phirpara\AppData\Local\Temp\git\1525341577493'...
fatal: Unable to find remote helper for 'https'
[ERROR] An error occurred while running cordova plugin add
http://github.com/apache/cordova-plugins.git#master:wkwebview... (exit code 1).

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

Just a note that this issue can also appear if you install cordova-plugin-local-notifications with an s instead of cordova-plugin-local-notification.

None of this has worked for me. --nofetch allows me to "add" the plugin but the build fails. I cant get even a clean Ionic3 app (ie newly created) to simply build once I add local notifications and most of the time i simply cant even add the plugin.
If anyone has a bunch of steps that work on a clean new project it would be most appreciated!

how about in Phonegap Build?

`Build Date: 2018-12-31 07:43:45 +0000

PLUGIN OUTPUT

Fetching plugin "cordova-plugin-battery-status@~1.2.4" via npm
Installing "cordova-plugin-battery-status" at "1.2.5" for android
Fetching plugin "cordova-plugin-camera@~2.4.1" via npm
Installing "cordova-plugin-camera" at "2.4.1" for android
Fetching plugin "cordova-plugin-compat@^1.1.0" via npm
Installing "cordova-plugin-compat" at "1.2.0" for android
Subproject Path: CordovaLib
Fetching plugin "cordova-plugin-media-capture@~1.4.3" via npm
Installing "cordova-plugin-media-capture" at "1.4.3" for android
Fetching plugin "cordova-plugin-file@^4.0.0" via npm
Installing "cordova-plugin-file" at "4.3.3" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

  "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.

Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Fetching plugin "cordova-plugin-device@~1.1.6" via npm
Installing "cordova-plugin-device" at "1.1.7" for android
Fetching plugin "cordova-plugin-dialogs@~1.3.3" via npm
Installing "cordova-plugin-dialogs" at "1.3.4" for android
Plugin "cordova-plugin-file" already installed on android. Making it top-level.
Fetching plugin "cordova-plugin-geolocation@~2.4.3" via npm
Installing "cordova-plugin-geolocation" at "2.4.3" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Fetching plugin "cordova-plugin-globalization@~1.0.7" via npm
Installing "cordova-plugin-globalization" at "1.0.9" for android
Fetching plugin "cordova-plugin-inappbrowser@~1.7.1" via npm
Installing "cordova-plugin-inappbrowser" at "1.7.2" for android
Fetching plugin "cordova-plugin-network-information@~1.3.3" via npm
Installing "cordova-plugin-network-information" at "1.3.4" for android
Fetching plugin "cordova-plugin-vibration@~2.1.5" via npm
Installing "cordova-plugin-vibration" at "2.1.6" for android
Fetching plugin "cordova-plugin-x-toast@~2.6.0" via npm
Installing "cordova-plugin-x-toast" at "2.6.2" for android
"plugman-151 install --platform android --project /project --plugin cordova-plugin-local-notifications --nohooks=.": Fetching plugin "cordova-plugin-local-notifications" via npm
Installing "de.appplant.cordova.plugin.local-notification" at "0.8.2dev" for android
Fetching plugin "org.apache.cordova.device" via npm
Failed to install 'de.appplant.cordova.plugin.local-notification': CordovaError: Failed to fetch plugin org.apache.cordova.device via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Not found : org.apache.cordova.device
at /usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/pgb-cordova-lib/src/plugman/fetch.js:215:37
at _rejected (/usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:797:24)
at /usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:823:30
at Promise.when (/usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:741:41)
at /usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:557:44
at flush (/usr/local/lib/npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Failed to fetch plugin org.apache.cordova.device via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Not found : org.apache.cordova.device`

I have same issue when I build it.

When using Phonegap Build you need to remove:

source="git"

and use

git+https://github.com/... in plugin's spec

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idehweb picture idehweb  Â·  24Comments

MaZZly picture MaZZly  Â·  79Comments

haha8x picture haha8x  Â·  31Comments

alesgenova picture alesgenova  Â·  30Comments

julianlecalvez picture julianlecalvez  Â·  22Comments