我使用'npm install量角器'在本地文件夾中安裝了protractor
。安裝完成後,我使用protractor --version
檢查了量角器的版本。當在本地安裝時,「量角器」不被識別爲內部或外部命令
但它是給出了錯誤:
'protractor' is not recognized as an internal or external command, operable program or batch file
如何解決這個問題?
我使用'npm install量角器'在本地文件夾中安裝了protractor
。安裝完成後,我使用protractor --version
檢查了量角器的版本。當在本地安裝時,「量角器」不被識別爲內部或外部命令
但它是給出了錯誤:
'protractor' is not recognized as an internal or external command, operable program or batch file
如何解決這個問題?
如果安裝在本地使用 npm install protractor
你的模塊將只在本地目錄進行安裝。
您應該使用npm install -g protractor
,它將在全局路徑中安裝模塊並使其可用作環境變量。這樣你的機器就可以將它識別爲命令。
我有Windows Server 2016上的一個類似的問題應按以下步驟解決這個問題:
確保安裝是全球性的。
npm install -g protractor
確保NPM設置在PATH環境變量。轉到「爲您的系統編輯環境變量」,將以下行追加到Path變量。
%USERPROFILE%\AppData\Roaming\npm