【发布时间】:2018-11-06 22:24:15
【问题描述】:
我正在尝试使用该命令安装 angular cli。
sudo npm install -g @angular/cli@latest
但它会引发以下错误:
npm ERR! path /usr/bin/ng<br>
npm ERR! code EEXIST<br>
npm ERR! Refusing to delete /usr/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/lib/node_modules/@angular/cli<br>
npm ERR! File exists: /usr/bin/ng<br>
npm ERR! Move it away, and try again.<br>
npm ERR! A complete log of this run can be found in:
npm ERR! /home/sachin/.npm/_logs/2018-11-06T13_58_33_153Z-debug.log
我试过下面的命令
sudo npm cache clear --force
sudo rm -rf /usr/local/bin/ng
但每次都出现上述错误。
【问题讨论】:
-
检查ng是否存在
-
@Seenivasan 怎么做?
-
@sachinmukherjee
ng --version -
和
sudo rm -rf /usr/bin/ng? -
它显示以下输出
The program 'ng' is currently not installed. You can install it by typing:sudo apt install ng-common。
标签: node.js angular npm angular-cli