簡體   English   中英

錯誤! 代碼 ENOENT 安裝錯誤離子科爾多瓦

[英]npm ERR! code ENOENT installation error ionic cordova

我嘗試安裝 ionic 和cordova(就像之前很多次一樣 - 沒有任何問題),但沒有成功。 總有這樣的:

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 cache clean。 但遺憾的是沒有任何結果。

以下是 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 ]

有沒有人知道可能有什么問題? 謝謝!

我遇到了同樣的問題! 我認為是緩存問題。 我刪除了“C:\\Users\\Username.cordova”目錄,然后轉到“C:\\Users\\Username\\AppData\\Roaming\\npm\\node_modules\\”,我刪除了cordova 目錄。 然后再次運行“npm install -g cordova”。它對我有用! 我希望它能有所幫助!

得到了同樣的錯誤。 似乎存在一些版本不匹配問題。 即使我們嘗試為 node 和 npm 安裝最新版本,npm intsall cordova 也會失敗並給出錯誤 4058。所以最好重新開始。

npm install npm@latest -g
npm cache clean
npm uninstall -g cordova
npm install -g cordova

這解決了我的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM