2016-11-06 186 views
0

我試圖安裝離子和科爾多瓦(像以前很多次 - 沒有任何問題),它沒有奏效。 總是有這樣的:npm ERR!代碼ENOENT安裝錯誤離子科爾多瓦

npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\n 
pm-cli.js" "install" "-g" "cordova" "ionic" 
npm ERR! node v7.0.0 
npm ERR! npm v3.10.8 
npm ERR! path C:\Users\Bastian\AppData\Roaming\npm\node_modules\.staging\abbrev-d5384ff1 
npm ERR! code ENOENT 
npm ERR! errno -4058 
npm ERR! syscall rename 

我試了幾個版本的Node.js和NPM緩存清理。但遺憾的是,沒有任何結果。

下面是來自NPM-一些的debug.log行:

72036 silly gunzTarPerm modified mode [ 'node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/request/node_modules/aws-sign2/index.js', 
72036 silly gunzTarPerm 420, 
72036 silly gunzTarPerm 438 ] 
72037 silly gunzTarPerm extractEntry node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/request/node_modules/bl/package.json 
72038 silly gunzTarPerm modified mode [ 'node_modules/ionic-app-lib/node_modules/cordova-lib/node_modules/npm/node_modules/request/node_modules/bl/package.json', 
72038 silly gunzTarPerm 420, 
72038 silly gunzTarPerm 438 ] 





81575 error Windows_NT 6.3.9600 
81576 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova" "ionic" 
81577 error node v6.9.1 
81578 error npm v3.10.8 
81579 error path C:\Users\Bastian\AppData\Roaming\npm\node_modules\.staging\abbrev-d5384ff1 
81580 error code ENOENT 
81581 error errno -4058 
81582 error syscall rename 
81583 error enoent ENOENT: no such file or directory, rename 'C:\Users\Bastian\AppData\Roaming\npm\node_modules\.staging\abbrev-d5384ff1' -> 'C:\Users\Bastian\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
81584 error enoent ENOENT: no such file or directory, rename 'C:\Users\Bastian\AppData\Roaming\npm\node_modules\.staging\abbrev-d5384ff1' -> 'C:\Users\Bastian\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
81584 error enoent This is most likely not a problem with npm itself 
81584 error enoent and is related to npm not being able to find a file. 
81585 verbose exit [ -4058, true ] 

有任何人的想法可能是什麼問題?謝謝!

+0

您是否檢查該文件夾是否存在C:\ Users \ Bastian \ AppData \ Roaming \ npm \ node_modules \?嘗試在管理員模式下運行它'cmd'(如果尚未),並查看它是否與安全問題有關。 – Searching

+0

是的,該文件夾存在(包含子文件夾:cordova,firebase-tools,ionic)。 cmd在管理員模式下沒有區別 – bastifix

+0

什麼是您的nodejs/npm版本,您是如何安裝的? – Marko

回答

0

我遇到了同樣的問題!我認爲這是緩存問題。我刪除'C:\ Users \ Username.cordova'目錄,然後轉到'C:\ Users \ Username \ AppData \ Roaming \ npm \ node_modules \',我刪除了cordova目錄。然後再次運行「npm install -g cordova」,它適用於我!我希望它可以幫助!

+0

是的,謝謝!刪除這些目錄使它! – bastifix

0

得到了同樣的錯誤。似乎有一些版本不匹配問題。即使我們嘗試安裝節點和npm的最新版本,但npm intsall cordova未能提供錯誤4058.因此,最好重新開始。

npm install [email protected] -g 
npm cache clean 
npm unistall -g cordova 
npm intsall -g cordova 

這解決了我的問題。

相關問題