node.js 使用 phonegap/cordova 时,“节点”未被识别为内部或外部命令、可运行的程序或批处理文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23412938/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
'node' is not recognized as an internal or an external command, operable program or batch file while using phonegap/cordova
提问by Meghana
I am using phonegap/cordova.
我正在使用 phonegap/cordova。
Everthing is installed propelry i.e cordova, phonegap, ant,sdk,jdk.
一切都安装了 propelry,即cordova、phonegap、ant、sdk、jdk。
But now it says "node is not recogzed as an internal or external command"
但现在它说“节点不被识别为内部或外部命令”
回答by webmato
In Windows, you need to set node.js folder path into system variables or user variables.
在 Windows 中,您需要将 node.js 文件夹路径设置为系统变量或用户变量。
1) open Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables
1)打开控制面板->系统和安全->系统->高级系统设置->环境变量
2) in "User variables" or "System variables" find variable PATHand add node.js folder path as value. Usually it is C:\Program Files\nodejs;. If variable doesn't exists, create it.
2) 在“用户变量”或“系统变量”中找到变量PATH并添加 node.js 文件夹路径作为值。通常是C:\Program Files\nodejs;。如果变量不存在,则创建它。
3) Restart your IDE or computer.
3) 重新启动您的 IDE 或计算机。
It is useful add also "npm" and "Git" paths as variable, separated by semicolon.
添加“npm”和“Git”路径作为变量很有用,用分号分隔。
回答by Travis
Great answers, but you could just open the command prompt and type in
很好的答案,但您可以打开命令提示符并输入
SET PATH=C:\Program Files\Nodejs;%PATH%
回答by Oush
Worked for me by running the command prompt as an administrator
通过以管理员身份运行命令提示符对我来说有效
回答by Dong
Add a system variable named "node", with value of your node path. It solves my problem, hope it helps.
添加名为“node”的系统变量,其值为您的节点路径。它解决了我的问题,希望它有所帮助。
回答by hipertracker
If you install Node using the windows installer, there is nothing you have to do. It adds path to node and npm.
如果您使用windows installer安装 Node ,则无需执行任何操作。它添加了节点和 npm 的路径。
You can also use Windows setxcommand for changing system environment variables. No reboot is required. Just logout/login. Or just open a new cmd window, if you want to see the changing there.
您还可以使用 Windows setx命令来更改系统环境变量。不需要重新启动。只需注销/登录。或者只是打开一个新的 cmd 窗口,如果你想看到那里的变化。
setx PATH "%PATH%;C:\Program Files\nodejs"
回答by Hymanalope
As you're using Windows, installation should automatically edit the %PATH% variable. Therefore, I suspect you simply need to reboot your system after installing.
当您使用 Windows 时,安装应自动编辑 %PATH% 变量。因此,我怀疑您只需要在安装后重新启动系统即可。
回答by Erik Waters
If you already have node installed, your path variable is set up and you suddenly start getting this error; try updating to the latest version.
如果您已经安装了节点,则您的路径变量已设置,并且您突然开始收到此错误;尝试更新到最新版本。
This worked for me going from 6.9.2 to 6.10.
这对我从 6.9.2 到 6.10 有用。

