npm 命令返回消息 -g' 未被识别为内部或外部命令 [英] npm command return message -g' is not recognized as an internal or external command

查看:72
本文介绍了npm 命令返回消息 -g' 未被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 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' 不是内部或外部命令,也不是可运行的程序或批处理文件.

I'm using Windows 8.1 64-bit and install npm with Windows Installer from nodejs.org. Every time i enter npm command, it always showing this message: 'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command, operable program or batch file.

错误运行 npm 时prefix -g 未被识别为内部或外部命令" 没有解决我的问题

节点 -v

v6.10.0

npm -v

'CALL "C:\Program Files\nodejs\node.exe";"C:\程序Files\nodejs\node_modules\npm\bin\npm-cli.js"前缀 -g' 不是被识别为内部或外部命令、可运行的程序或批处理文件.

'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command, operable program or batch file.

3.10.10

npm config 获取注册表

'CALL "C:\Program Files\nodejs\node.exe";"C:\程序Files\nodejs\node_modules\npm\bin\npm-cli.js"前缀 -g' 不是被识别为内部或外部命令、可运行的程序或批处理文件.

'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command, operable program or batch file.

https://registry.npmjs.org/

推荐答案

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

It solved now. it is not an error of nodejs PATH. But one of my environment variable named ComSpec has multiple value, it only allow one

这篇关于npm 命令返回消息 -g' 未被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆