我最初使用运行 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.
最佳答案
你的命令是错误的:
它是 @angular/cli
带有正斜杠而不是 @angular\cli
npm install -g @angular/cli
为了在 windows 上安装 angular-cli
npm install -g @angular/cli
代替 npm install –g @angular-cli
关于node.js - 运行命令 npm install -g @angular\cli 后,我收到一个 npm ERR!编码 ENOLOCAL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45544104/