'node' is not recognized as an internal or external command, operable program or batch file ❓ [How to Solve]
So I opened up a command line from Visual Studio for the web site and tried to run grunt. That is where I got a real error message: "'node' is not recognized as an internal or external command, operable program or batch file."
A quick search around the web led me to believe the node executable was not in my PATH. Sure enough it was missing. Once I added node to my path I had to restart visual studio and sure enough everything worked again.
- Open Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables
- In "User variables" or "System variables" find variable PATH and add node.js folder path as value. Usually it is C:\Program Files odejs;. If variable doesn't exists, create it.
- Restart your IDE or computer.
In case you are wondering the node executable should be in your C:\Program Files\nodejs folder.
In case you needed to check your PATH you can view it by right clicking the Computer in File Explorer or from the security settings in Control Panel. Once there select Advanced System Settings. A dialog will open with the Advanced tab selected. At the bottom is a button, Environment Variables.
Tapping it will open the variables dialog, which should have your system's PATH variable. Make sure the node path is added, if not added it.
After doing this restart Visual Studio or open a fresh command prompt. From the command prompt type 'node -v' to echo the node version installed.
You can also add the path to node or any other application directly on the command line. Open up a command line console as an administrator and type the following (assuming this is your path to node).
SET PATH=C:\Program Files\Nodejs;%PATH%
You should also check to make sure npm and Git are part of your system PATH. If not add them to your Paths as variable, separated by semicolon.
I wish I knew how node was removed from my path, but I guess that is left for another day. I hope this helps you out. Feel free to leave a comment if you have more advice to share.