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

Windowsnode.jsInstallation

Windows Problem Overview


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?

Windows Solutions


Solution 1 - Windows

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%;...

Solution 2 - Windows

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.

Solution 3 - Windows

Go to the folder in which you have Node and NPM (such as C:\Program Files (x86)\nodejs\) and type the following:

> set path=%PATH%;%CD%
> setx path "%PATH%"

From http://www.hacksparrow.com/install-node-js-and-npm-on-windows.html

Solution 4 - Windows

Everytime I install node.js it needs a reboot and then the path is recognized.

Solution 5 - Windows

Watch out for other paths ending in \ too. I had this:

...bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs\

and changed it to this:

bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs

removing the final , but it still didn't work. The previous path, for the Web Platform Installer, had a trailing \ too. Removing that fixed the problem.

Solution 6 - Windows

Try adding C:\Program Files\Nodejs to your PATH environment variable. The PATH environment variable allows run executables or access files within the folders specified (separated by semicolons).

On the command prompt, the command would be set PATH=%PATH%;C:\Program Files\Nodejs.

Solution 7 - Windows

Make sure nodejs in the PATH is in front of anything that uses node.

Solution 8 - Windows

I set the NODEJS variable in the system control panel but the only thing that worked to set the path was to do it from command line as administrator.

SET PATH=%NODEJS%;%PATH%

Another trick is that once you set the path you must close the console and open a new one for the new path to be taken into account.

However for the regular user to be able to use node I had to run set path again not as admin and restart the computer

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsellarafaeliView Question on Stackoverflow
Solution 1 - WindowsFirst ZeroView Answer on Stackoverflow
Solution 2 - WindowsVarun AcharView Answer on Stackoverflow
Solution 3 - WindowsalessioalexView Answer on Stackoverflow
Solution 4 - WindowsRandallToView Answer on Stackoverflow
Solution 5 - Windowsuser1207577View Answer on Stackoverflow
Solution 6 - WindowsGio BorjeView Answer on Stackoverflow
Solution 7 - WindowsSandersjr2View Answer on Stackoverflow
Solution 8 - WindowspasxView Answer on Stackoverflow