When I try to run "npm" from VS Code terminal, I get the error "Command ‘npm’ not found."
Now, when using other Ubuntu terminal, the npm runs flawlessly. npm has been installed. However, in VSCode terminal window, neither node.js nor npm is found to be installed.
What am I missing here?
I tried reinstalling npm but didn’t work.
3
Answers
Got the same thing once. All you need to do is close Visual Studio Code and it should work correctly after reopening it.
Please check the env variable in those two terminals.
You can use
echo $PATH
And if the results in two terminal are different, please correct with the right one.
Please tell me if this doesn’t work.
Hope good luck.
I’m not sure about ubuntu but for mac you can change the shell vscode is using if your vscode shell and the one in terminal differs then you can change the one vscode is using: