2016-11-11 159 views
1

我試圖安裝離子和返回此錯誤:錯誤與故宮安裝離子時,在Windows上安裝-g離子科爾多瓦10

95376 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\ionic\node_modules\ionic-app-lib\node_modules\glob-watcher\node_modules\chokidar\node_modules\fsevents): 
95377 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin 
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any 
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32 
95378 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 
95379 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
95379 verbose stack  at destStatted (C:\Users\<username>\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:25:7) 
95379 verbose stack  at C:\Users\<username>\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29 
95379 verbose stack  at FSReqWrap.oncomplete (fs.js:123:15) 
95379 verbose stack 
95379 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
95379 verbose stack  at Error (native) 
95380 verbose cwd C:\Users\<username>\Documents\sc-ionic 
95381 error Windows_NT 10.0.14393 
95382 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\<username>\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic" "cordova" 
95383 error node v6.9.1 
95384 error npm v3.10.9 
95385 error path C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea 
95386 error code ENOENT 
95387 error errno -4058 
95388 error syscall rename 
95389 error enoent ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
95390 error enoent ENOENT: no such file or directory, rename 'C:\Users\<username>\AppData\Roaming\npm\node_modules\.staging\abbrev-afcbf2ea' -> 'C:\Users\<username>\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
95390 error enoent This is most likely not a problem with npm itself 
95390 error enoent and is related to npm not being able to find a file. 
95391 verbose exit [ -4058, true ] 

它試圖重新命名一些不存在的目錄「縮寫,afcbf2ea」在npm模塊中。

+1

試着通過'npm cache clean'來重新安裝它們。我在Windows 10上安裝了它,2個小時後,它工作 – harishr

+0

嘗試'npm install abbrev'然後嘗試o安裝'ionic' –

+0

這些解決方案都不起作用! :/我已經安裝了離子,並在我的應用程序上正常工作,但是當我安裝「cordova」時仍然返回此錯誤。 –

回答

1

我已經解決去除node_modules夾,然後運行:

npm install -g --save ionic cordova 

我認爲這是一個緩存的問題時,一些wents錯誤的依賴安裝離子+科爾多瓦的那個崩潰node_modules路徑!