katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.76k forks source link

Unable to install the plugin in Windows #1325

Closed changty closed 6 years ago

changty commented 7 years ago

Your Environment

rwillett commented 7 years ago

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

changty commented 7 years ago

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.

rwillett commented 7 years ago

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

halindrome commented 7 years ago

Actually it is failing on max os x now too.

rwillett commented 7 years ago

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.

changty commented 7 years ago

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.

changty commented 7 years ago

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 de.appplant.cordova.plugin.local-notification@0.8.5

Installing "de.appplant.cordova.plugin.local-notification" for android
Plugin dependency "cordova-plugin-device@1.1.6" 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
rwillett commented 7 years ago

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.

changty commented 7 years ago

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 de.appplant.cordova.plugin.local-notification@0.8.5

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

rwillett commented 7 years ago

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

Tawpie commented 7 years ago

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

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...

changty commented 7 years ago

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

rwillett commented 7 years ago

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

Mistes974 commented 7 years ago

Same problem here .. :/

tsoposki commented 7 years ago

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

skywalker1992 commented 7 years ago

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

d3w201 commented 7 years ago

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 npm@3.10.10
3 info using node@v6.10.2
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 ]
d3w201 commented 7 years ago

[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! ;)

skywalker1992 commented 7 years ago

@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.

d3w201 commented 7 years ago

@skywalker1992 happy to be helpful mate 👍 !

katzer commented 6 years ago

try to add with --nofetch