2017-08-27 102 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包成功!