Reputation: 1177
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?
Upvotes: 56
Views: 149060
Reputation: 1
I have tried most of the above steps, but the issue didn't resolve. So I uninstalled and installed node.js and it worked for me.
C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin
Upvotes: 0
Reputation: 29
Just write this on your terminal (CMD) and it should work just fine:
SET PATH=C:\Program Files\Nodejs;%PATH%
Upvotes: 1
Reputation: 417
I have tried most of the above steps, but the issue didn't resolve. So I uninstalled and installed node.js and it worked for me.
Upvotes: 0
Reputation: 2975
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
Upvotes: 0
Reputation: 57
Make sure nodejs in the PATH is in front of anything that uses node.
Upvotes: 0
Reputation: 395
Everytime I install node.js it needs a reboot and then the path is recognized.
Upvotes: 6
Reputation: 699
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.
Upvotes: 4
Reputation: 15099
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.
Upvotes: 46
Reputation: 63653
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
Upvotes: 18
Reputation: 22356
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%;...
Upvotes: 127
Reputation: 21094
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
.
Upvotes: 1