-->

Node not recognized although successfully installe

2020-08-09 06:31发布

问题:

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.

回答1:

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.



回答2:

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!