2017-08-27 193 views
0

我有角4安裝錯誤

目前我正在運行的節點版本v6.11.2 & NPM版本5.3.0

我第一次嘗試使用sudo npm install -g @angular/cli安裝它麻煩安裝@角/ CLI包和這得到了循環運行下面的錯誤,直到我CTRL + C出來:

gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp" 
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space 
gyp verb command install [ '6.11.2' ] 
gyp verb install input version string "6.11.2" 
gyp verb install installing version: 6.11.2 
gyp verb install --ensure was passed, so won't reinstall if already installed 
gyp verb install version not already installed, continuing with install 6.11.2 
gyp verb ensuring nodedir is created /usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/6.11.2 
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/6.11.2" 

尋找一個解決方案,我用工作都是圍繞sudo npm install --unsafe-perm -g @angular/cli,而是遇到下面的錯誤嘗試後:

npm ERR! code EAI_AGAIN 
npm ERR! errno EAI_AGAIN 
npm ERR! request to https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443 

誰能請指教?

+0

更新你的nodejs到'8.x'將修復這個錯誤 – Aravind

回答

0

我剛找到解決這個問題的方法!

看起來像NPM安裝了錯誤的用戶權限?我用sudo chown -R $USER /usr/local然後安裝了node-gyp-install,之後安裝了@ angular/cli包成功!