2016-09-19 167 views
-1

我試圖安裝離子2幾個小時,但我沒有成功。 而我用命令CMD安裝科爾多瓦「故宮安裝-g科爾多瓦」 我得到這個錯誤npm install -g cordova和ionic 2錯誤

npm ERR! Windows_NT 10.0.14393 
 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Adir\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova" 
 
npm ERR! node v4.5.0 
 
npm ERR! npm v3.10.7 
 
npm ERR! path C:\Users\Adir\AppData\Roaming\npm\node_modules\.staging\abbrev-ed18b12b 
 
npm ERR! code ENOENT 
 
npm ERR! errno -4058 
 
npm ERR! syscall rename 
 

 
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Adir\AppData\Roaming\npm\node_modules\.staging\abbrev-ed18b12b' -> 'C:\Users\Adir\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
 
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Adir\AppData\Roaming\npm\node_modules\.staging\abbrev-ed18b12b' -> 'C:\Users\Adir\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev' 
 
npm ERR! enoent This is most likely not a problem with npm itself 
 
npm ERR! enoent and is related to npm not being able to find a file. 
 
npm ERR! enoent 
 

 
npm ERR! Please include the following file with any support request: 
 
npm ERR!  C:\Users\Adir\npm-debug.log 
 
npm ERR! code 1

當我安裝該命令「故宮安裝-g離子離子「 我得到這個錯誤

npm WARN In [email protected] replacing bundled version of semver with [email protected] 

NPM WARN在[email protected][email protected]更換離子-APP-lib中的捆綁版本npm ERR! Windows_NT 10.0.14393 npm ERR! argv「C:\ Program Files \ nodejs \ node.exe」「C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules \ npm \ bin \ npm-cli.js」「install」「-g」「ionic」 npm ERR!節點v4.5.0 npm ERR! npm v3.10.7 npm ERR!路徑C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules.staging \ ansi-75d35ef1 npm ERR!代碼ENOENT npm ERR! errno -4058 npm ERR!系統調用重命名

npm ERR! enoent ENOENT:沒有這樣的文件或目錄,重命名'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules.staging \ ansi-75d35ef1' - >'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules \ ionic \ node_modules \ cordova-lib \ node_modules \ ansi' npm ERR! enoent ENOENT:沒有這樣的文件或目錄,重命名'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules.staging \ ansi-75d35ef1' - >'C:\ Users \ Adir \ AppData \ Roaming \ npm \ node_modules \ ionic \ node_modules \ cordova-lib \ node_modules \ ansi' npm ERR! enoent這很可能不是npm本身的問題 npm ERR!並且與npm無法找到文件有關。 npm ERR! enoent

npm ERR!請包括以下任何支持請求的文件: npm ERR! C:\ Users \ Adir \ npm-debug.log npm ERR!代碼1

回答

1

校驗和失敗npm ERR! shasum檢查失敗

您可以嘗試升級到故宮的最新版本:

npm install -g npm 

要升級到NPM 3。

另外:

npm cache clean 

enter code here 

NPM組註冊表https://registry.npmjs.org/

2

什麼固定我的問題是我試圖unistalling並通過BREW在Mac
重新安裝節點 npm cache clean
brew uninstall --force node
rm -r /usr/local/lib/node_modules
brew install node

現在,如果你運行 「的節點」
它應該在我的.bash_profile /usr/local/bin/node

現在設置NODE_PATH爲
export NODE_PATH=/usr/local/lib/node_modules

這一點,給了我後不問題什麼那麼有

1
1 - Install the latest version of NodeJS from their website (e.g. 6.X.X). 
2 - Open the Node.js command prompt as administrator. 
3 - Run: npm cache clean 
4 - Run: npm uninstall -g ionic 
5 - Run: npm uninstall -g cordova 
6 - Run: npm install -g ionic 
7 - Run: npm install -g cordova 
1

好像你有一些版本不匹配的問題。所以下載最新的節點,安裝最新的npm並重新啓動。

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