89
votes

I am using phonegap/cordova.

Everthing is installed propelry i.e cordova, phonegap, ant,sdk,jdk.

But now it says "node is not recogzed as an internal or external command"

12
Node.js is a requirement ... install it for your OS (nodejs.org) - mortsahl
i have installed node.js - Meghana
do i have to set environment variables? - Meghana
Make sure it's in your path - mortsahl
path variable has only nodejs's path or even ant path? - Meghana

12 Answers

144
votes

In Windows, you need to set node.js folder path into system variables or user variables.

1) open Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables

2) in "User variables" or "System variables" find variable PATH and add node.js folder path as value. Usually it is C:\Program Files\nodejs;. If variable doesn't exists, create it.

3) Restart your IDE or computer.

It is useful add also "npm" and "Git" paths as variable, separated by semicolon.

88
votes

Great answers, but you could just open the command prompt and type in

SET PATH=C:\Program Files\Nodejs;%PATH%
32
votes

Worked for me by running the command prompt as an administrator

15
votes

Add a system variable named "node", with value of your node path. It solves my problem, hope it helps.

10
votes

If you install Node using the windows installer, there is nothing you have to do. It adds path to node and npm.

You can also use Windows setx command 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.

setx PATH "%PATH%;C:\Program Files\nodejs"
9
votes

As you're using Windows, installation should automatically edit the %PATH% variable. Therefore, I suspect you simply need to reboot your system after installing.

2
votes

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.

2
votes

Be aware that the Path is case sensitive. I tried setx PATH and it didn't work. In my case it was setx Path. Make sure your CMD run as Administrator.

setx Path "%PATH%;C:\Program Files\nodejs"

Now just restart your command prompt (or restart the PC) and the node command should be available.

2
votes

Also, try to run nvm on to turn on the node. Worked for me.

0
votes

In windows search bar type "enviroment variable" open it and set path

C:\Program Files\nodejs;

After adding path in system enviroment variable, If problem still occurs then follow steps

  • Close cmd and open new cmd, try "node" command.
  • For VS code close all windows and reopen then try "node" command.
  • If above steps didn't work then restart system.(this one worked for me)
0
votes

In my case, I'm using NVM and it installed Node v16.2.0, which for some reason has node.exe named as node64.exe. I changed it to node.exe and everything just worked.

0
votes

In my case I was using nvm-windows and JetBrains Rider. The required paths were specified in environment variables, but MSBuild wasn't picking them up. Apparently I haven't rebooted my PC after installing NVM. Rebooting the PC fixed the problem.