Cordova-plugin-local-notifications: ELOOP: too many symbolic links encountered

Created on 19 Jun 2017  Â·  13Comments  Â·  Source: katzer/cordova-plugin-local-notifications

Your Environment

  • Plugin version: 0.8.5
  • Platform: Android
  • OS version: Linux 4.4 ( Ubuntu 16.04 )
  • Device manufacturer / model: Genymotion / ADV emulator
  • Cordova version (cordova -v): 7.0.1
  • Cordova platform version (cordova platform ls): android 6.2.3
  • Plugin config
  • Ionic Version (if using Ionic) : 3.4.0

Expected Behavior

Should be installed the plugin sucessfully

Actual Behavior

Throws npm error:

npm ERR! path /home/marcelo/Documents/ionic/newblank/node_modules/cordova-plugin-app-event/package.json
npm ERR! code ELOOP
npm ERR! errno -40
npm ERR! syscall open
npm ERR! ELOOP: too many symbolic links encountered, open '/home/marcelo/Documents/ionic/newblank/node_modules/cordova-plugin-app-event/package.json'

npm ERR! A complete log of this run can be found in:
npm ERR! /home/marcelo/.npm/_logs/2017-06-19T14_09_29_521Z-debug.log

Steps to Reproduce

_Reproduce this issue; include code to reproduce, if relevant_

  1. ionic start newBlank blank
  2. ionic cordova plugin add de.appplant.cordova.plugin.local-notification
  3. npm install --save @ ionic-native/local-notifications

Context

Start a new and clean ionic project with local notifications

Debug logs

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '--save',
1 verbose cli '@ionic-native/local-notifications' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 16e292c3ded2cd7c
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/@ionic-native%2flocal-notifications 1285ms (from cache)
8 silly pacote tag manifest for @ionic-native/local-notifications@latest fetched in 1322ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly fetchPackageMetaData error for cordova-plugin-app-event@file:node_modules/cordova-plugin-app-event ELOOP: too many symbolic links encountered, open '/home/marcelo/Documents/ionic/newblank/node_modules/cordova-plugin-app-event/package.json'
13 verbose stack Error: ELOOP: too many symbolic links encountered, open '/home/marcelo/Documents/ionic/newblank/node_modules/cordova-plugin-app-event/package.json'
14 verbose cwd /home/marcelo/Documents/ionic/newblank
15 verbose Linux 4.4.0-79-generic
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "@ionic-native/local-notifications"
17 verbose node v7.8.0
18 verbose npm v5.0.3
19 error path /home/marcelo/Documents/ionic/newblank/node_modules/cordova-plugin-app-event/package.json
20 error code ELOOP
21 error errno -40
22 error syscall open
23 error ELOOP: too many symbolic links encountered, open '/home/marcelo/Documents/ionic/newblank/node_modules/cordova-plugin-app-event/package.json'
24 verbose exit [ -40, true ]

Most helpful comment

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.

All 13 comments

Ok, let's go! I changed the node and npm versions using n and downgraded to:

System:

    Node       : v7.8.0
    npm        : 4.2.0

Again, rerunning the same commands and same step by step:

1) ionic start newBlank blank

Log:

marcelo@marcelo-X555LF:~/Documents/ionic$ ionic start teste blank
✔ Creating directory ./teste - done!
[INFO] Fetching app base
       (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
✔ Downloading - done!
[INFO] Fetching starter template blank
       (https://github.com/ionic-team/ionic2-starter-blank/archive/master.tar.gz)
✔ Downloading - done!
✔ Updating package.json with app details - done!
✔ Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
> npm install
✔ Running command - done!
> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
✔ Running command - done!
> git init
✔ Running command - done!
> git add -A
✔ Running command - done!
> git commit -m "Initial commit" --no-gpg-sign
✔ Running command - done!

♬ ♫ ♬ ♫  Your Ionic app is ready to go! ♬ ♫ ♬ ♫

Run your app in the browser (great for initial development):
  ionic serve

Run on a device or simulator:
  ionic cordova run ios

Test and share your app on a device with the Ionic View app:
  http://view.ionic.io

? Link this app to your Ionic Dashboard to use tools like Ionic View? No

Go to your newly created project: cd ./teste

2) ionic cordova plugin add de.appplant.cordova.plugin.local-notification

Log:

marcelo@marcelo-X555LF:~/Documents/ionic/teste$ ionic cordova plugin add de.appplant.cordova.plugin.local-notification
> cordova plugin add de.appplant.cordova.plugin.local-notification --save
✔ Running command - done!
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.
Installing "cordova-plugin-app-event" for android
ANDROID_HOME=/opt/android-sdk/
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_dz89hvvt6lwni0ughmk25dddr.run(/home/marcelo/Documents/ionic/teste/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:clean
:CordovaLib:clean

BUILD SUCCESSFUL

Total time: 1.414 secs
Subproject Path: CordovaLib
Adding de.appplant.cordova.plugin.local-notification to package.json
Saved plugin info for "de.appplant.cordova.plugin.local-notification" to config.xml

3) npm install --save @ionic-native/local-notifications

Log:

marcelo@marcelo-X555LF:~/Documents/ionic/teste$ npm install --save @ionic-native/local-notifications
[email protected] /home/marcelo/Documents/ionic/teste
└── @ionic-native/[email protected] 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/home/marcelo/Documents/ionic/teste/node_modules/etc/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/marcelo/Documents/ionic/teste/node_modules/node_modules/package.json'

And finally, without errors:

4) ionic cordova build android

marcelo@marcelo-X555LF:~/Documents/ionic/teste$ ionic cordova build androidRunning app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[20:20:45]  build dev started ... 
[20:20:46]  clean started ... 
[20:20:46]  clean finished in 3 ms 
[20:20:46]  copy started ... 
[20:20:46]  transpile started ... 
[20:20:48]  transpile finished in 2.21 s 
[20:20:48]  preprocess started ... 
[20:20:48]  deeplinks started ... 
[20:20:48]  deeplinks finished in 11 ms 
[20:20:48]  preprocess finished in 13 ms 
[20:20:48]  webpack started ... 
[20:20:48]  copy finished in 2.36 s 
[20:20:55]  webpack finished in 7.21 s 
[20:20:55]  sass started ... 
[20:20:56]  sass finished in 1.12 s 
[20:20:56]  postprocess started ... 
[20:20:56]  postprocess finished in 4 ms 
[20:20:56]  lint started ... 
[20:20:56]  build dev finished in 10.61 s 
> cordova build android
â ‡ Running command [20:20:58]  lint finished in 1.98 s 
✔ Running command - done!
ANDROID_HOME=/opt/android-sdk/
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_dz89hvvt6lwni0ughmk25dddr.run(/home/marcelo/Documents/ionic/teste/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 14.947 secs
Built the following apk(s): 
    /home/marcelo/Documents/ionic/teste/platforms/android/build/outputs/apk/android-debug.apk

So the workaround is to downgrade npm?

EDIT: Here is my complete workaround.

  1. Downgrade to NPM 3
  2. Remove strange symlinks for cordova-plugin-device and cordova-plugin-app-events from node_modules
  3. Manually add [email protected] and [email protected] using cordova add plugin --save
  4. No add the plugin cordova plugin add --save de.appplant.cordova.plugin.local-notification
cd $PROJECT_DIR
rm node_modules/cordova-plugin-device
rm node_modules/cordova-plugin-app-events
cordova add --save [email protected]
cordova add --save [email protected]
cordova plugin add --save de.appplant.cordova.plugin.local-notification 

For me it was enough to downgrade npm to npm i -g [email protected]. Still using node v8.1.4.

Then i reinstalled everything:

ionic cordova platform rm ios android
rm -rf node_modules platforms plugins package-lock.json
ionic cordova platform add ios
ionic cordova platform add android

@ben-8409 @marioleed

Yep! As @toddmedema in that issue. The problem is the old repo whitout the package.json file and new versions of NPM not know how to solve the pending...

npm@5 has only been trouble since the start, no matter what minor or patch version. Also, npm -g outdated did not show outdated global packages (except until 5.2.0). The package-lock.jsonis another source of trouble and I'm not entirely convinced that the self-healing cache is doing good things.

Anyway, for me the problem was with cordova-plugin-dialogs... and then the same with the cordova-plugin-geolocation.

At least it works now =)

Hi All, i have same problem, so i downgrade Node from 6.12.0 to 6.10.2
but it still happen... :/

C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile>npm -v
3.10.10

C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile>node -v
v6.10.2

that's my output when i try to add this plugin ..
```` C:\Users\XXXX-4038\workspace\cfportal\src\web\mobile>cordova plugin add --save de.appplant.cordova.plugin.local-notif
ication --verbose
No scripts found for hook "before_plugin_add".
No version specified for de.appplant.cordova.plugin.local-notification, retrieving version from package.json
Calling plugman.fetch on plugin "de.appplant.cordova.plugin.local-notification@^0.8.5"
saving
Running command: cmd "/s /c ""C:\Program Filesnodejsnpm.cmd" install de.appplant.cordova.plugin.local-notification@
^0.8.5 --save""
Command finished with error code 0: cmd /s /c ""C:\Program Filesnodejsnpm.cmd" install de.appplant.cordova.plugin.l
ocal-notification@^0.8.5 --save"
Copying plugin "C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobilenode_modules\de.appplant.cordova.plugin.local-no
tification" => "C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobileplugins\de.appplant.cordova.plugin.local-notific
ation"
Calling plugman.install on plugin "C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobileplugins\de.appplant.cordova.p
lugin.local-notification" for platform "android
Installing "de.appplant.cordova.plugin.local-notification" for android
Running command: cmd "/s /c "C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobile\platforms\android\cordova\version.b
at""
Command finished with error code 0: cmd /s /c "C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobile\platforms\android
\cordova\version.bat"
Dependencies detected, iterating through them...
Requesting plugin "cordova-plugin-device".
Plugin dependency "cordova-plugin-device" not fetched, retrieving then installing.
saving
Running command: cmd "/s /c ""C:\Program Filesnodejsnpm.cmd" install cordova-plugin-device --save""
Command finished with error code 4294963238: cmd /s /c ""C:\Program Filesnodejsnpm.cmd" install cordova-plugin-devi
ce --save"
Failed to install 'de.appplant.cordova.plugin.local-notification': CordovaError: Failed to fetch plugin cordova-plugi
n-device 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\cfportalsrc\web\mobilenode_modulesnode_modules\co
rdova-plugin-device
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" "cordova-plugin-device" "--save"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! path C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobilenode_modulesnode_modules\cordova-plugin-device
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\cfportalsrc\web\mobilenode_mo
dulesnode_modules\cordova-plugin-device'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobilenode_mo
dulesnode_modules\cordova-plugin-device'
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\cfportalsrc\web\mobilenode_modulesnpm-debug.log
at C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-libsrc\plugman\fetch.js:205:
33
at _rejected (C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-fetchnode_modules
\q\q.js:864:24)
at C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-fetchnode_modules\q\q.js:890
:30
at Promise.when (C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-fetchnode_modu
les\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cord
ova-fetchnode_modules\q\q.js:808:41)
at C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-fetchnode_modules\q\q.js:624
:44
at runSingle (C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-fetchnode_modules
\q\q.js:137:13)
at flush (C:\Users\XXXX-4038AppData\Roamingnpmnode_modules\cordovanode_modules\cordova-fetchnode_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-device 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\cfportalsrc\web\mobilenode_modulesnode_modules\co
rdova-plugin-device
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" "cordova-plugin-device" "--save"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! path C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobilenode_modulesnode_modules\cordova-plugin-device
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\cfportalsrc\web\mobilenode_mo
dulesnode_modules\cordova-plugin-device'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\XXXX-4038\workspace\cfportalsrc\web\mobilenode_mo
dulesnode_modules\cordova-plugin-device'
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\cfportalsrc\web\mobilenode_modulesnpm-debug.log
`````
And the 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   'cordova-plugin-device',
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 cordova-plugin-device@file:node_modules\cordova-plugin-device
8 silly fetchOtherPackageData cordova-plugin-device@file:node_modules\cordova-plugin-device
9 silly cache add args [ 'cordova-plugin-device@file:node_modules\\cordova-plugin-device',
9 silly cache add   null ]
10 verbose cache add spec cordova-plugin-device@file:node_modules\cordova-plugin-device
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'cordova-plugin-device@file:node_modules\\cordova-plugin-device',
11 silly cache add   scope: null,
11 silly cache add   escapedName: 'cordova-plugin-device',
11 silly cache add   name: 'cordova-plugin-device',
11 silly cache add   rawSpec: 'file:node_modules\\cordova-plugin-device',
11 silly cache add   spec: 'C:\\Users\\XXX-4038\\workspace\\cfportal\\src\\web\\mobile\\node_modules\\node_modules\\cordova-plugin-device',
11 silly cache add   type: 'local' }
12 error addLocal Could not install C:\Users\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device
13 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open 'C:\Users\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device'
13 silly fetchPackageMetaData     at Error (native)
13 silly fetchPackageMetaData  error for cordova-plugin-device@file:node_modules\cordova-plugin-device { Error: ENOENT: no such file or directory, open 'C:\Users\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device'
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\\XXX-4038\\workspace\\cfportal\\src\\web\\mobile\\node_modules\\node_modules\\cordova-plugin-device' }
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\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device'
18 verbose stack     at Error (native)
19 verbose cwd C:\Users\XXX-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" "cordova-plugin-device" "--save"
22 error node v6.10.2
23 error npm  v3.10.10
24 error path C:\Users\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device
25 error code ENOENT
26 error errno -4058
27 error syscall open
28 error enoent ENOENT: no such file or directory, open 'C:\Users\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device'
29 error enoent ENOENT: no such file or directory, open 'C:\Users\XXX-4038\workspace\cfportal\src\web\mobile\node_modules\node_modules\cordova-plugin-device'
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 ]

also tryed to install cordova plugin-device & cordova-plugin-app-events but when i install the second one that's my result :(

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 ]

kindest regards guys and thank you so much..

[EDIT][SOLVED]

i solved copyng the cordova-plugin-app-event from iOS plugin directories to my android plugins directory (from iOS/projectName/plugin to windowsUser/projectName/plugin)

Hi,
Do these solutions work on windows?
I am on windows and this problem has persisted despite trying to downgrade my npm._

ies of course , it work for me in windows 10! i try to downgrade or upgrade cordova and node but problem was persist until i move the entire folder from my apple machine to my windows ... anyway have you installed first cordova-plugin-device?

Hi guys,

I faced the same issue today. My node and update versions were Node: v6.11.0 & NPM: 5.0.4

I updated both Node (downloaded the stable release) and NPM (command: npm install npm@latest -g).
Now the plugin has been installed successfully using the commands.

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

npm install --save @ionic-native/local-notifications

After update the versions are

Node: 6.11.1

npm: 5.3.0

I use a Windows 10 machine and I am building a ionic2 app.

Thought this might help

Cheers,
SD.

have you install cordova-plugin-device? have you a macOS system also virtualzed?
try to make a new cordova project on that system and type :

add cordova-plugin-app-events --save

then go inside you cordova mac/project/plugins directory and copy the entire cordova-plugin-app-event folder and put it in your windows machine ... then from your windows machine type :

cordova plugin rm de.appplant.cordova.plugin.local-notification
cordova plugin add cordova-plugin-device --save
cordova plugin add de.appplant.cordova.plugin.local-notification --save --verbose

if it dont work copy and paste your command-line output and the npm-debug.log (you will find it on
path/to/project/node_modules/npm-debug.log )

For me the solution was between; adding "C:\Windows\System32" to my path variables, deleting the .cordova folder, and deleting android and ionic from C:\Users\PaulAppData\Roamingnpmnode_modules. I of course did the npm cache clean. Then I did a fresh installation of ionic-cordova or just cordova, then I run 'cordova platform add android'. Everything was fine!

Using windows 7
node 6.11.0
npm 3.10.10

I had this issue with another NPM package after upgrading to npm 5.3.0
In my case, the problem was that the package-lock.json file that was created by npm used the existing node_modules folder for the information for the lock file.
The solution was to delete the package-lock.json, delete node_modules, then reinstall npm modules.

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.

Was this page helpful?
0 / 5 - 0 ratings