0
安裝@角/ CLI當我執行命令:npm install -g @angular/cli
我得到一個錯誤:無法在Linux
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
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! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
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! A complete log of this run can be found in:
npm ERR! /home/my_user_name/.npm/_logs/2017-07-13T13_36_06_285Z-debug.log
然後我試圖執行命令:sudo npm install -g @angular/cli
但我得到了一個錯誤:
npm ERR! path /usr/local/bin/ng
npm ERR! code EEXIST
npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin
npm ERR! File exists: /usr/local/bin/ng
npm ERR! Move it away, and try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/my_user_name/.npm/_logs/2017-07-13T13_39_01_642Z-debug.log
如果連sudo priviliges都不夠,我該如何安裝Angular-CLI?
嘗試刪除/ usr/local/bin/ng manualy(作爲root) – TGrif
我這樣做,現在我得到一個錯誤,描述爲https://github.com/angular/angular-cli/issues/6848但解決方案在我的示例中不起作用。 – user