'The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program
I'm getting this error while running node in my VS Code terminal besides I tried to run the same thing in CMD and it worked there but not in VS Code terminal:
node: The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ node
+ ~~~~
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Solution 1:[1]
What worked for me was : open Visual Studio Code -> Terminal -> New Terminal
Everything else I tried didn't...
Solution 2:[2]
I also got this error, I resolved it by opening Visual Studio Code with Run as administrator privilages (in Windows).
Solution 3:[3]
Try closing and then reopening VS Code.
If you have installed node while VS Code was opened then the change to the PATH won't be visible yet. (be sure that the add to PATH option is selected while installing node...if not be sure to add it to the PATH)
Solution 4:[4]
I faced the same error. And the solution I found is while reinstalling on the last step it asked if we wanted to install Choclatey and other few files that may be required, I unticked that option and Whola it worked. I dont know the technicality why it worked but it worked.
Solution 5:[5]
I faced the same problem, it's because I select an option to install chocolatey and python during installation process . When I try to uninstall my node installed and try to reinstall without choosing option to install chocolatey and python it works for me .... enter image description here
Solution 6:[6]
if you have anaconda installed, everytime vscode the terminal, infact the vscode opens the conda environment,
you can solve it by typing,
conda install -c conda-forge nodejs
Solution 7:[7]
Add node to your environment variable using following steps. If your operating system is windows 10, Right click "This PC" -> Properties Properties
Then click "Advance system settings" and click "Environment Variable" button as follow
Then select the path and click Edit button User Variables for Administrator
For the above error you have to add node js location. Click New and add node file path. C:\Program Files\nodejs
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | LAM Wai-Him |
Solution 2 | itsHarshad |
Solution 3 | JoJo |
Solution 4 | Zenish Prajapati |
Solution 5 | Mathi |
Solution 6 | Hb.ZHANG |
Solution 7 | Buddhi Kandegama |