2017-08-07 191 views
1

我最初使用的是運行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. 
+0

嘗試字符/不\ \ –

回答

3

你的命令是錯誤的:

這是@angular/cli正斜槓不@angular\cli

npm install -g @angular/cli 

爲了在Windows上使用

安裝角-CLI npm install -g @angular/cli代替npm install –g @angular-cli