运行命令后npm install -g @angular \ cli我收到一个npm ERR!代码ENOLOCAL

时间:2017-08-07 09:53:25

标签: node.js angular npm command-line-interface

我最初使用的是运行Windows 10的计算机以及运行Windows 8.1的另一台计算机,但我仍在两台计算机上收到相同的消息。错误日志是:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "@angular\cli" as it does not contain a package.json file.

node和npm版本分别为8.2.1和5.3.0。

当我在git bash上运行命令时,我收到一条不同的错误消息。错误日志是:

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "@angularcli": Tags may not have any characters that encodeURIComponent encodes.

1 个答案:

答案 0 :(得分:8)

你的命令错了:

ExecutedRoutedEventArgs的正斜杠不是@angular/cli

@angular\cli

为了在Windows上安装angular-cli,请使用

npm install -g @angular/cli 代替npm install -g @angular/cli