如何解决这个问题

时间:2018-09-11 06:53:42

标签: angular

在控制台中调用 npm install 时,如何解决此错误:

krishan@krishan-Aspire-E1-571:~$ sudo npm install -g @angular/cli@6.0.8
[sudo] password for krishan: 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 
(node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! path /usr/bin/ng
npm ERR! code EEXIST
npm ERR! Refusing to delete /usr/bin/ng: ../lib/node_modules/angular- cli/bin/ng symlink target is not controlled by npm /usr/bin
npm ERR! File exists: /usr/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/krishan/.npm/_logs/2018-09-11T06_51_53_525Z-debug.log

Angular CLI:6.0.8

1 个答案:

答案 0 :(得分:1)

忽略此警告。您发布的警告是针对fsevents的,这是一个可选的依赖项,仅在OS X上可用。