Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'node' is not recognized as an internal or external command

I've been working with node.js v0.6.3, locally installed on Windows Vista at C:\Program Files\Nodejs. I recently upgraded to (by running the installer for) v0.6.6. It seemed like it worked for a while, but now if I try to run node from any directory I get a

'node' is not recognized as an internal or external command

message, though running node from C:\Program Files\Nodejs does work.

I tried rebooting, removing node, reinstalling, reinstalling 0.6.3 - nothing seems to work. I just don't get why node fails to recognize system path, though node works from its base dir?

like image 609
sellarafaeli Avatar asked Jan 07 '12 09:01

sellarafaeli


People also ask

How do you fix node is not recognized as an internal or external command?

Click on the edit system environment variables, a window will open where you have to click on Environment Variables. The Environment Variables window will open where you have to select or double click on the variable Path. Now paste the complete path where Node. js was installed.

Why is node not recognized in Visual Studio code?

1 Answer. Show activity on this post. You must click the Kill Terminal button (highlighted) and then restart VS Code and node will start working again. Best on making a change of system environment variable Path is restarting Windows to make sure that really all processes make use of the modified Path variable.

Where npm where is not recognized as an internal or external command?

npm is not recognized as internal or external command operable program or batch file. I figured out that node js is installed in C:\Program Files\nodejs. Opening a command prompt in this directory makes npm work fine.


2 Answers

Node is missing from the SYSTEM PATH, try this in your command line

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

and then try running node

To set this system wide you need to set in the system settings - cf - http://banagale.com/changing-your-system-path-in-windows-vista.htm

To be very clean, create a new system variable NODEJS

NODEJS="C:\Program Files\Nodejs" 

Then edit the PATH in system variables and add %NODEJS%

PATH=%NODEJS%;... 
like image 135
First Zero Avatar answered Sep 23 '22 08:09

First Zero


Nodejs's installation adds nodejs to the path in the environment properties incorrectly.

By default it adds the following to the path:

C:\Program Files\nodejs\ 

The ending \ is unnecessary. Remove the \ and everything will be beautiful again.

like image 22
Varun Achar Avatar answered Sep 21 '22 08:09

Varun Achar