Meghana
Meghana

Reputation: 1328

'node' is not recognized as an internal or an external command, operable program or batch file while using phonegap/cordova

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"

Upvotes: 132

Views: 629200

Answers (20)

Aykut Atmaca
Aykut Atmaca

Reputation: 31

You can try to run on "Node.js command prompt" enter image description here

Upvotes: 0

Alireza Fattahi
Alireza Fattahi

Reputation: 45485

Make sure that the node.exe exists in C:\Program Files\nodejs\, then add it to the path. ( See above answers to see how)

I am using chocolate package manger for installing nodejs by running choco install nodejs. Surprisingly in some versions the node.exe was not created in C:\Program Files\nodejs\ !

So make sure the node.exe is in C:\Program Files\nodejs\

Upvotes: -1

                                **Wnidows-11**

control panel---Advance system setting----Enviornment Variable---new----Variable Name(Path) Varibale value(C:\Program Files\nodejs or whichever your path)

Afterwards restart your cli and node -v then boom!!

enter image description hereenter image description hereenter image description here

Upvotes: -1

Bikale G
Bikale G

Reputation: 82

Try to add the version at the end in the PATH variable

C:\Program Files\nodejs\16.x.x

Upvotes: 0

Nick
Nick

Reputation: 29

I tried the solutions above but uninstall and reinstall of nodejs from installer the only one worked for me.

Upvotes: 1

Muhammad Fahad Ado
Muhammad Fahad Ado

Reputation: 117

enter image description here

For me I just click on empty session and it works for me

Upvotes: -4

hilmidemirtas
hilmidemirtas

Reputation: 40

I had the same problem. My solution was just restart :/ If you have this problem, you should just try restart first...

Upvotes: -1

Tanmay Patil
Tanmay Patil

Reputation: 699

Please install node through nvm

following command will give you the path where node is installed .

nvm root

Current Root: C:\Users\u725561\AppData\Roaming\nvm

node would be present inside the subdirectory of nvm root .

add the directory C:\Users\u725561\AppData\Roaming\nvm\v12.22.2 to path environment variable.

Upvotes: -1

Eternal21
Eternal21

Reputation: 4664

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.

Upvotes: -1

AlphaBeta
AlphaBeta

Reputation: 1033

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.

Upvotes: 1

Travis
Travis

Reputation: 1816

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

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

Upvotes: 139

Robert Hovhannisyan
Robert Hovhannisyan

Reputation: 3335

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

Upvotes: 9

GAURAV MOKASHI
GAURAV MOKASHI

Reputation: 2034

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)

Upvotes: 0

ADM-IT
ADM-IT

Reputation: 4180

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.

Upvotes: 3

Oush
Oush

Reputation: 3348

Worked for me by running the command prompt as an administrator

Upvotes: 46

Erik Waters
Erik Waters

Reputation: 327

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.

Upvotes: 1

hipertracker
hipertracker

Reputation: 2458

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"

Upvotes: 11

webmato
webmato

Reputation: 2171

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.

Upvotes: 198

Jack
Jack

Reputation: 2285

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

Upvotes: 8

Dong
Dong

Reputation: 434

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

Upvotes: 16

Related Questions