`npm install`不起作用。未处理的拒绝错误:EISDIR:目录上的非法操作

时间:2019-03-20 06:06:21

标签: node.js macos ionic-framework npm npm-install

我正在开发 ionic 3 应用。我在 windows 10 上进行了开发,一切都很好。但是现在我将工作 windows转移到了mac 。 现在的问题是,当我在Mac上运行npm install命令时,它无法正常工作。它显示Unhandled rejection Error。完整错误如下。

  

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/content-v2/sha512/11/85'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/index-v5/9c/8c'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/index-v5/c8/4b'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/index-v5/7c/dc'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/content-v2/sha512/6c/ff'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/content-v2/sha512/63/ae'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/content-v2/sha512/b4/ba'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/index-v5/61/df'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/content-v2/sha512/a7/af'

     

未处理的拒绝错误:EISDIR:对目录的非法操作,   打开'/Users/softograph/.npm/_cacache/content-v2/sha512/59/b7'

     

npm错误! cb()从未调用过!

     

npm错误!这是npm本身的错误。请报告此错误   在:npm ERR! https://npm.community

     

npm错误!有关此运行的完整日志,请参见:npm ERR!
  /Users/softograph/.npm/_logs/2019-03-20T05_55_54_280Z-debug.log

环境配置

Node: v8.9.3

npm: 6.7.0

我的日志文件是

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)

谢谢大家

1 个答案:

答案 0 :(得分:0)

您是否将.npm从Windows复制到macOS? 也许您可以尝试删除有问题的目录,然后再次运行npm install。像

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

或者它可能是权限问题。实际上,您永远不要将sudonpm一起使用。我建议您尝试使用nvm(节点版本管理器),它将为您安装node和npm。使用nvm,您将从不需要sudo

相关问题