简体   繁体   中英

`npm install` not working. Unhandled rejection Error: EISDIR: illegal operation on a directory

I am developing an ionic 3 app. I developed it on windows 10 and everything was fine. But now I shift my work windows to mac . Now problem is when i run npm install command on mac, then it's not working. It shows Unhandled rejection Error . Full errors are given below.

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/content-v2/sha512/11/85'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/index-v5/9c/8c'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/index-v5/c8/4b'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/index-v5/7c/dc'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/content-v2/sha512/6c/ff'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/content-v2/sha512/63/ae'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/content-v2/sha512/b4/ba'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/index-v5/61/df'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/content-v2/sha512/a7/af'

Unhandled rejection Error: EISDIR: illegal operation on a directory, open '/Users/softograph/.npm/_cacache/content-v2/sha512/59/b7'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at: npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in: npm ERR!
/Users/softograph/.npm/_logs/2019-03-20T05_55_54_280Z-debug.log

Environment Configuration

Node: v8.9.3

npm: 6.7.0

My Log file is

info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ]
2 info using npm@6.7.0
3 info using node@v8.9.3
4 verbose npm-session aa41030c4bd27115
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall azmaeen@0.0.1
7 info lifecycle azmaeen@0.0.1~preinstall: azmaeen@0.0.1
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 12ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 5ms
16 silly install loadAllDepsIntoIdealTree
17 http fetch GET 200 https://registry.npmjs.org/@angular%2fanimations 125ms (from cache)
18 http fetch GET 200 https://registry.npmjs.org/@ionic%2fapp-scripts 136ms (from cache)
19 silly pacote range manifest for @angular/animations@^5.2.9 fetched in 143ms
20 silly pacote version manifest for @ionic/app-scripts@3.1.8 fetched in 156ms
21 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fcore 10ms (from cache)
22 silly pacote version manifest for @ionic-native/core@4.4.0 fetched in 13ms
23 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fdevice 3ms (from cache)
24 silly pacote range manifest for @ionic-native/device@^4.6.0 fetched in 5ms
25 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2ffcm 4ms (from cache)
26 silly pacote range manifest for @ionic-native/fcm@^4.7.0 fetched in 6ms
27 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2flocal-notifications 9ms (from cache)
28 silly pacote range manifest for @ionic-native/local-notifications@^4.7.0 fetched in 12ms
29 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fnetwork 3ms (from cache)
30 silly pacote range manifest for @ionic-native/network@^4.6.0 fetched in 4ms
31 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fscreen-orientation 4ms (from cache)
32 silly pacote range manifest for @ionic-native/screen-orientation@^4.7.0 fetched in 6ms
33 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fsocial-sharing 3ms (from cache)
34 silly pacote range manifest for @ionic-native/social-sharing@^4.7.0 fetched in 5ms
35 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fsplash-screen 3ms (from cache)
36 silly pacote version manifest for @ionic-native/splash-screen@4.4.0 fetched in 4ms
37 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fstatus-bar 3ms (from cache)
38 silly pacote version manifest for @ionic-native/status-bar@4.4.0 fetched in 4ms
39 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2fstripe 3ms (from cache)
40 silly pacote range manifest for @ionic-native/stripe@^4.7.0 fetched in 4ms
41 http fetch GET 200 https://registry.npmjs.org/@ionic-native%2funique-device-id 3ms (from cache)
42 silly pacote range manifest for @ionic-native/unique-device-id@^4.6.0 fetched in 4ms
43 http fetch GET 304 https://registry.npmjs.org/@angular%2fforms 370ms (from cache)
44 silly pacote version manifest for @angular/forms@5.0.3 fetched in 405ms
45 http fetch GET 304 https://registry.npmjs.org/@angular%2fcompiler 420ms (from cache)
46 silly pacote version manifest for @angular/compiler@5.0.3 fetched in 426ms
47 http fetch GET 304 https://registry.npmjs.org/@angular%2fplatform-browser 434ms (from cache)
48 http fetch GET 304 https://registry.npmjs.org/@angular%2fcore 440ms (from cache)
49 silly pacote version manifest for @angular/platform-browser@5.0.3 fetched in 442ms
50 silly pacote version manifest for @angular/core@5.0.3 fetched in 446ms
51 http fetch GET 304 https://registry.npmjs.org/@angular%2fcompiler-cli 455ms (from cache)
52 silly pacote version manifest for @angular/compiler-cli@5.0.3 fetched in 461ms
53 http fetch GET 304 https://registry.npmjs.org/@angular%2fhttp 463ms (from cache)
54 silly pacote version manifest for @angular/http@5.0.3 fetched in 467ms
55 http fetch GET 304 https://registry.npmjs.org/cordova-android 145ms (from cache)
56 silly pacote version manifest for cordova-android@7.0.0 fetched in 161ms
57 http fetch GET 304 https://registry.npmjs.org/cordova-plugin-fcm 144ms (from cache)
58 silly pacote range manifest for cordova-plugin-fcm@^2.1.2 fetched in 145ms
59 http fetch GET 304 https://registry.npmjs.org/cordova-plugin-ionic-webview 136ms (from cache)
60 silly pacote range manifest for cordova-plugin-ionic-webview@^1.1.19 fetched in 139ms
61 http fetch GET 304 https://registry.npmjs.org/@angular%2fcommon 626ms (from cache)
62 silly pacote version manifest for @angular/common@5.0.3 fetched in 629ms
63 http fetch GET 304 https://registry.npmjs.org/@angular%2fplatform-browser-dynamic 564ms (from cache)

Thanks Everyone

Did you copy .npm from windows to macOS? Maybe you can try to remove the problematic directory and then run npm install again. Something like

$ rm -rf /Users/softograph/.npm/

OR it might be permission problem. You actually should never use sudo with npm . I suggest you try to use nvm (node version manager) and it will install node and npm for you. With nvm, you will never need sudo .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM