我想安裝ionic2,我已經安裝了node.js(v6.10)和android sdk。安裝離子時出現錯誤2
當我運行
npm install -g ionic cordova
我得到這個錯誤:
npm cache clean
brew uninstall --force node
rm -r /usr/local/lib/node_modules
brew install node
編輯:通過自制軟件解決了該問題
npm WARN In [email protected] replacing bundled version of mime-types with [email protected] npm WARN In [email protected] replacing bundled version of cross-spawn with [email protected] npm WARN In [email protected] replacing bundled version of semver with [email protected] npm WARN In [email protected] replacing bundled version of form-data with [email protected] npm WARN In [email protected] replacing bundled version of request with [email protected] npm WARN In [email protected] replacing bundled version of ionic-app-lib with [email protected] npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ionic" "cordova" npm ERR! node v6.10.0 npm ERR! npm v3.10.10 npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-ef9cc920 npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev' npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/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! /Users/ege/Desktop/ionic2/npm-debug.log
是什麼操作系統您installling安裝的NodeJS?如果在Mac或Ubuntu上,您必須在npm install -g cordova ionic之前使用sudo。它可能是一個權限錯誤 – yaboiduke
@yaboiduke它的Mac sudo沒有解決我的問題,我要卸載節點並重新安裝自制軟件 –