angular / cli安装时给我错误

时间:2018-09-08 21:14:18

标签: angular angular-cli

当我在安装后将角形安装在终端中时,出现此错误 我已经安装了: 节点v6.10.3

npm ERR! Darwin 17.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "@angular/cli"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/macmini/npm-debug.log

2 个答案:

答案 0 :(得分:0)

请在系统中以管理模式尝试

npm install -g @angular/cl

答案 1 :(得分:-2)

通过这种方式,我可以解决我的问题:

1- empety cash npm 
2- global install angular 
3- sudo ~