Cordova-plugin-local-notifications: Unable to install the plugin in Windows

Created on 15 Jun 2017  路  21Comments  路  Source: katzer/cordova-plugin-local-notifications

Your Environment

  • Plugin version: 0.8.3
  • Platform: Windows 10
  • OS version: 1607
  • Device manufacturer / model: -
  • Cordova version (cordova -v): 7.0.1
  • Cordova platform version (cordova platform ls):
Installed platforms:
  android 6.2.3
  browser 4.1.0
  ios 4.4.0
Available platforms:
  blackberry10 ~3.8.0 (deprecated)
  webos ~3.7.0
  windows ~5.0.0
  • Plugin config
<?xml version='1.0' encoding='utf-8'?>
<widget id="fi.utu.ville.ViLLEMobile" version="1.2.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.
apache.org/ns/1.0">
...
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="mailto:*" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="SplashScreen" value="splash" />
    <preference name="SplashScreenDelay" value="5000" />
    <preference name="Orientation" value="default" />
    <engine name="android" spec="^6.2.3" />
    <engine name="browser" spec="^4.1.0" />
    <engine name="ios" spec="^4.4.0" />
    <plugin name="cordova-plugin-console" spec="^1.0.7" />
    <plugin name="cordova-plugin-device" spec="^1.1.6" />
    <plugin name="cordova-plugin-dialogs" spec="^1.3.3" />
    <plugin name="cordova-plugin-globalization" spec="^1.0.7" />
    <plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
    <plugin name="cordova-plugin-network-information" spec="^1.3.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
</widget>

What happens

Trying to install the plugin but it fails with following error:

Failed to install 'de.appplant.cordova.plugin.local-notification': Error
    at C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:205:33
    at _rejected (C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\
q.js:864:24)
    at C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:890:30
    at Promise.when (C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules
\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova
-fetch\node_modules\q\q.js:808:41)
    at C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:624:44
    at runSingle (C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\
q.js:137:13)
    at flush (C:...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js
:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161: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.
Error: cmd: Command failed with exit code 4294963229 Error output:
npm ERR! path C:\...\node_modules\cordova-plugin-app-event\package.json
npm ERR! code ELOOP
npm ERR! errno -4067
npm ERR! syscall open
npm ERR! ELOOP: too many symbolic links encountered, open 'C:\...\node_modules\co
rdova-plugin-app-event\package.json'

I'm not even able to open the the cordova-plugin-app-event folder in Windows explorer.

Windows

Most helpful comment

@d3w201 thank you very much!
I use your method to solve my problem.
I do not have a MAC,so I doing this in my windows:
install plugin:
cordova plugin add cordova-plugin-app-event
and install plugin:
cordova plugin add de.appplant.cordova.plugin.local-notification
then there is no problems.

All 21 comments

There are very, very few people doing stuff with Windows and this plugin. You may struggle to get help

Yep, I noticed when Googling the issue. I was hoping someone here might have a clue what to do about the symlink issue. Let's hope for the best.

I will try later how the plugin is handled on my linux setup.

It works fine on mac os x but that probably doesn't help you.

Actually it is failing on max os x now too.

Then you are doing so something wrong as it does install correctly for us.

Since you haven't explained how you are installing it, its difficult to say what the problem is. I do note that other people have had issues with npm versions, I suspect somebody has packaged them incorrectly.

I managed to install the library on Linux without problems. I even copied the cordova-plugin-app-event folder from Linux node_modules to Windows and tried to reinstall local-notifications plugin with following results:

PS C:\...\> cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications
Error: Failed to fetch plugin https://github.com/katzer/cordova-plugin-local-notifications 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

At least the folder is not a broken symlink anymore.

I managed to install cordova-plugin-app-event via npm using version 1.1.0. It doesn't seem to have the same symlink problem than the most recent 1.2.0. I know this is not an ideal solutions but I'm ready to try anything at this point.

Next error is probably due cordova plugin manager and not this plugin, but I'll report it anyway.

cordova plugin add [email protected]

Installing "de.appplant.cordova.plugin.local-notification" for android
Plugin dependency "[email protected]" 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 C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:205:33
    at _rejected (C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\
q.js:864:24)
    at C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules
\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova
-fetch\node_modules\q\q.js:808:41)
    at C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:624:44
    at runSingle (C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\
q.js:137:13)
    at flush (C:\Users\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js
:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161: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

Why are you using npm, are you saying the cordova plugin install doesn't work?

You still haven't said how you installed the plugin.

We use

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

and

cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10

which works fine.

I've just created a new dummy cordova project and installed both the old plugin and the IOS10 branch plugin.

Robs-MacBook-Pro:hello rwillett$ cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications
Fetching plugin "https://github.com/katzer/cordova-plugin-local-notifications" via git clone
Repository "https://github.com/katzer/cordova-plugin-local-notifications" checked out to git ref "master".
Robs-MacBook-Pro:hello rwillett$ cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
Fetching plugin "https://github.com/katzer/cordova-plugin-local-notifications" via git clone
Repository "https://github.com/katzer/cordova-plugin-local-notifications" checked out to git ref "ios10".
cp: dest file already exists: /Users/rwillett/Documents/src/hello/plugins/de.appplant.cordova.plugin.local-notification/CHANGELOG.md

It notes that I've already installed with the previous installation so it errors but it does show that it can be installed.

I wanted to test whether the problem is npm or cordova related and based on the results, it seems to be related to cordova plugin install.

Originally I tried to install the plugin using cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications, but when it failed, I did try the following: cordova plugin add [email protected]

Both of these commands are visible in my previous messages. Is there other information I could provide to you considering the plugin install procedure?

We just did it again and it worked fine for us on OS X. So I can only assume Windows does things differently.

@changty it's unlikely to help, but when things go sideways for me and I'm shotgunning-in-the-dark, I:

  • uninstall the platforms from cordova,
  • uninstall the plugins from cordova,
  • update cordova (optional, totally optional!)
  • install the plugins again (there aren't any platforms installed yet!)
  • finally add the platforms

It's a bit of a wacky sequence and YMMV, but has made several mystery problems go away in the past.

Good luck with windows BTW, it's been a couple of years since I used the plugin there. I don't even remember if I used VS's Cordova tools to handle the plugins or used cordova itself...

Thanks @Tawpie, I'll give it a shot next week. I've restarted the project couple of times but haven't uninstalled cordova (yet).

Other plugins suggest this as well. It sometimes works and sometimes doesn't.

Same problem here .. :/

I have the same issue on Windows, Linux and OS X.

Same problem here .. who can help me?? I need help!

Same problem :(
That's the output when i try to install using npm app-event

C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile>cordova plugin add cordova-plugin-app-event --save --verbose
No scripts found for hook "before_plugin_add".
No version specified for cordova-plugin-app-event, retrieving version from package.json
Calling plugman.fetch on plugin "file:node_modules\cordova-plugin-app-event"
saving
Running command: cmd "/s /c ""C:\Program Files\nodejs\npm.cmd" install file:node_modules\cordova-plugin-app-event --s
ave""
Command finished with error code 4294963238: cmd /s /c ""C:\Program Files\nodejs\npm.cmd" install file:node_modules\c
ordova-plugin-app-event --save"
Error: Failed to fetch plugin file:node_modules\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.
Error: cmd: Command failed with exit code 4294963238 Error output:
npm ERR! addLocal Could not install C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\co
rdova-plugin-app-event
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "
install" "file:node_modules\\cordova-plugin-app-event" "--save"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! path C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event

npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_mo
dules\node_modules\cordova-plugin-app-event'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_mo
dules\node_modules\cordova-plugin-app-event'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\npm-debug.log

and npm.log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'file:node_modules\\cordova-plugin-app-event',
1 verbose cli   '--save' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData file:node_modules\cordova-plugin-app-event
8 silly fetchOtherPackageData file:node_modules\cordova-plugin-app-event
9 silly cache add args [ 'file:node_modules\\cordova-plugin-app-event', null ]
10 verbose cache add spec file:node_modules\cordova-plugin-app-event
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'file:node_modules\\cordova-plugin-app-event',
11 silly cache add   scope: null,
11 silly cache add   escapedName: null,
11 silly cache add   name: null,
11 silly cache add   rawSpec: 'file:node_modules\\cordova-plugin-app-event',
11 silly cache add   spec: 'C:\\Users\\XXXX-4038\\workspace\\cfportal\\src\\web\\mobile\\node_modules\\node_modules\\cordova-plugin-app-event',
11 silly cache add   type: 'local' }
12 error addLocal Could not install C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event
13 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event'
13 silly fetchPackageMetaData     at Error (native)
13 silly fetchPackageMetaData  error for file:node_modules\cordova-plugin-app-event { Error: ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event'
13 silly fetchPackageMetaData     at Error (native)
13 silly fetchPackageMetaData   errno: -4058,
13 silly fetchPackageMetaData   code: 'ENOENT',
13 silly fetchPackageMetaData   syscall: 'open',
13 silly fetchPackageMetaData   path: 'C:\\Users\\XXXX-4038\\workspace\\cfportal\\src\\web\\mobile\\node_modules\\node_modules\\cordova-plugin-app-event' }
14 silly rollbackFailedOptional Starting
15 silly rollbackFailedOptional Finishing
16 silly runTopLevelLifecycles Finishing
17 silly install printInstalled
18 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event'
18 verbose stack     at Error (native)
19 verbose cwd C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules
20 error Windows_NT 10.0.14393
21 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "file:node_modules\\cordova-plugin-app-event" "--save"
22 error node v6.10.2
23 error npm  v3.10.10
24 error path C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event
25 error code ENOENT
26 error errno -4058
27 error syscall open
28 error enoent ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event'
29 error enoent ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-app-event'
29 error enoent This is most likely not a problem with npm itself
29 error enoent and is related to npm not being able to find a file.
30 verbose exit [ -4058, true ]

[i SOLVED doing this]

cordova plugin rm de.appplant.cordova.plugin.local-notification

cordova plugin add cordova-plugin-device

then copy from my MAC project directory : "myProject/plugin/cordova-plugin-app-event" to my WINDOWS project directory : "myProject/plugin/"

after this try again to install plugin:

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

4 me it works! ;)

@d3w201 thank you very much!
I use your method to solve my problem.
I do not have a MAC,so I doing this in my windows:
install plugin:
cordova plugin add cordova-plugin-app-event
and install plugin:
cordova plugin add de.appplant.cordova.plugin.local-notification
then there is no problems.

@skywalker1992 happy to be helpful mate 馃憤 !

try to add with --nofetch

Was this page helpful?
0 / 5 - 0 ratings