运行命令后npm install -g @angular \ cli我收到一个npm ERR!代码ENOLOCAL
问题描述:
我最初使用的是运行Windows 10的计算机,也运行Windows 8.1的另一台计算机上,但我仍然在两台计算机上收到相同的消息。错误日志为:运行命令后npm install -g @angular cli我收到一个npm ERR!代码ENOLOCAL
npm ERR! code ENOLOCAL
npm ERR! Could not install from "@angular\cli" as it does not contain a package.json file.
节点和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上使用
安装角-CLI npm install -g @angular/cli
代替npm install –g @angular-cli
尝试字符/不\ \ –