skip to Main Content

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


  1. Got the same thing once. All you need to do is close Visual Studio Code and it should work correctly after reopening it.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. 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:
    VSCode shell type

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search