我正在使用Windows 8.1 64位,並且使用nodejs.org的Windows Installer安裝npm。每次輸入npm命令時,它總是顯示以下消息: 'CALL「C:\ Program Files \ nodejs \ node.exe」「C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js」前綴-g'不被識別爲內部或外部命令,可操作程序或批處理文件。npm命令返回消息-g'不被識別爲內部或外部命令
Error while running npm 「prefix -g is not recognized as an internal or external command」沒有解決我的問題
節點-v
v6.10.0
NPM -v
「CALL「C:\程序文件s \ nodejs \ node.exe「」C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js「前綴-g」不是 被識別爲內部或外部命令,可操作程序或批次爲 文件。
3.10.10
NPM配置獲取註冊表
「CALL 「C:\ Program Files文件\的NodeJS \ node.exe」「C:\ PROGRAM 文件\的NodeJS \ node_modules \ npm \ bin \ npm-cli.js「前綴-g」不是 被識別爲內部或外部命令,可操作程序或 批處理文件。
對不起,我是nodejs中的新成員。我在我的項目文件夾中有.env文件,但沒有指向nodejs路徑的var。我把它們放到我的.env文件中? – Patriot
我的意思是你的Windows環境變量。有關如何在Windows中設置路徑的信息,請轉到「Windows Isntallation」:https://www.tutorialspoint.com/nodejs/nodejs_environment_setup.htm,網址爲:http://www.computerhope.com/issues/ch000549.htm – TanguyB
[https://www.tutorialspoint.com/nodejs/nodejs_environment_setup.htm](https://www.tutorialspoint.com/nodejs/nodejs_environment_setup.htm)仍然出現錯誤,C:\ Program Files \ nodejs \ bin不是存在於我的目錄 – Patriot