27

I try to run nodejs on a brand new installation of Windows 7. This is what I've done:

  1. Install node using the windows installer

  2. Make sure the files were extracted to C:\Program Files (x86)\nodejs\

  3. Make sure that my Path enviorment variable contains C:\Program Files (x86)\nodejs\

  4. open up a command prompt and run node -v

This gives me the 'node is not a recognized ...' - message.

What am I missing here?


Update running echo %path% gives me a directory listing that doesn't include C:\Program Files (x86)\nodejs\, even though looking at the "environment variables" tab in the system properties displays it under path. Thats odd.

10
  • 1
    Do you really think your laptop model matters? :p Apr 12, 2012 at 18:32
  • What's the full path to the binary? Is it in ...\nodejs\, or ...\nodejs\bin\, for example?
    – jimw
    Apr 12, 2012 at 18:32
  • 2
    @ThiefMaster: Hehe, no, not really. But when I have this kind of error that I really dont have a clue of the reason, I just try to include as much data as possible. The laptopmodel was probably just unnessesary though. Apr 12, 2012 at 18:35
  • @jimw: I dont even have a nodejs\bin. In the nodejs dir, I have just a node application file. Apr 12, 2012 at 18:36
  • 1
    Right, not that then. What does 'echo %PATH%' give you in your command shell? Sorry for the obvious questions :-)
    – jimw
    Apr 12, 2012 at 18:40

3 Answers 3

37

UPDATE: a quicker solution is per Timos comment: "Restarting explorer.exe is enough, you can stop it in task manager and start it again"

This was solved by restarting the computer.

Apparently, using the Node installer sets the path so that it is visible under system properties, but not in the command prompt (running echo %path%) until you restart your computer. Not sure if this is a problem with Windows, or the Node Installer.

5
  • Changes to the System Properties will not affect any open command prompts. You can simply re-open a new command prompt for the new PATH to take effect. Or manually add it in your %PATH% for existing command prompt.
    – Hanxue
    Jan 6, 2013 at 21:52
  • 2
    I'm not 100% sure since this was a while ago, but I believe i did re-open the command prompt. Jan 7, 2013 at 9:52
  • 3
    I can confirm the behaviour Soroush found. I didn't have any command prompts open, but the path wasn't picking up node after an install.
    – pnewhook
    Jan 9, 2013 at 17:25
  • 26
    Restarting explorer.exe is enough, you can stop it in task manager and start it again Jan 13, 2013 at 20:49
  • Another confirmation. I thought closing and reopening the command prompt window would enable it, but it didn't. Restarting explorer did it though without a restart.
    – rball
    Sep 12, 2014 at 22:20
15

Timo's statement is accurate. For completeness...

To start explore.exe again, Ctrl+Shift+Esc to open Task Manager

Then do File > New Task (Run)> type: explorer.exe > Enter > Voila!

5
  • I guess as a developer, I already knew this? He did say restart explorer so I'm not sure how it is inaccurate.
    – rball
    Sep 12, 2014 at 22:21
  • 7
    I said it was accurate - I was simply helping by providing the steps to accomplish it. I would've added it in a comment, but don't have the required rep to do so. Sep 14, 2014 at 14:35
  • 1
    To extend @sesamechicken and @Timo 's correct comments to the CLI; this can be done via a single line in cmd. taskkill /f /im explorer.exe && explorer.exe. This will kill the explorer.exe process and restart it.
    – S3DEV
    Jan 12, 2018 at 11:15
  • 1
    Can you believe this issue is still happening? Restarting from the task manager using the menu option in Windows 10 doesn't work, at least for me. You must start explorer.exe again.
    – ATL_DEV
    Jan 21, 2020 at 17:14
  • @S3DEV This worked for me but only after the desired new PATH was updated in same cmd.
    – jifb
    May 26, 2021 at 13:55
1

If node is installed via nvm.

Then it's important to run the command nvm use <installed version>.

And, it will hopefully work after that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.