【问题标题】:npm install error : using this command "npm install -g @angular/cli"npm 安装错误:使用此命令“npm install -g @angular/cli”
【发布时间】:2017-11-30 18:45:07
【问题描述】:

当我尝试 npm install new packages 时,它显示了这个错误:

rollbackFailedOptional:动词 npm-session dcdf458f5e794f1

nodejs-版本:

v8.9.1

npm -版本:

5.5.1

enter image description here

【问题讨论】:

  • 您在链接的图像中有错字
  • 意思是……你看不到图片?
  • 你在图片中写了@amgular/cli。并且错误日志与代理有关,所以很可能你落后于一个并且没有相应地配置 npm
  • 抱歉拼写错误...但我再次尝试使用“npm install -g @angular/cli”命令...仍然发生相同的错误日志

标签: angular angular-cli


【解决方案1】:

以管理员身份打开cmd并写入:

npm install -g @angular/cli

【讨论】:

  • 我也试过这种方式...但同样的错误来了
  • npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080
  • 命令提示符中仍然出现与“rollbackFailedOptional: verb npm-session dcdf458f5e794f1”相同的错误
  • @sankeerthR : npm config rm proxy npm config rm https-proxy 并重新启动。
【解决方案2】:

如果你想更新 angular/cli(参见https://github.com/angular/angular-cli

npm uninstall -g @angular/cli
npm cache clean
# if npm version is > 5 then use `npm cache verify` to avoid errors (or to avoid using --force)
npm install -g @angular/cli@latest

【讨论】:

  • 我也尝试过这种方式......但同样的错误与网络连接有关
猜你喜欢
  • 2018-07-30
  • 2017-11-09
  • 1970-01-01
  • 1970-01-01
  • 2020-12-19
  • 1970-01-01
  • 1970-01-01
  • 2018-05-08
  • 2021-02-13
相关资源
最近更新 更多