首页 文章

npm命令返回消息-g'未被识别为内部或外部命令

提问于
浏览
1

我正在使用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'不被识别为内部或外部命令,可操作程序或批处理文件 .

Error while running npm “prefix -g is not recognized as an internal or external command”没有解决我的问题

node -v

v6.10.0

npm -v

'CALL'C:\ Program Files \ nodejs \ node.exe“”C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js“prefix -g'不被识别为内部或外部命令,可操作程序或批处理文件 . 3.10.10

npm config get registry

'CALL'C:\ Program Files \ nodejs \ node.exe“”C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js“prefix -g'不被识别为内部或外部命令,可操作程序或批处理文件 . https://registry.npmjs.org/

2 回答

  • 0

    它现在解决了 . 它不是nodejs PATH的错误 . 但是我的一个名为ComSpec的环境变量有多个值,它只允许一个

  • 2

    此错误指的是您的PATH变量未指向NodeJS的正确路径 . 仔细检查你的环境 . 变量并检查它是否设置为正确的路径 .

相关问题