npm : Unable to Recognize "npm" as a Cmdlet, Function, Script File, or Executable Program in VSCode

12 Views Asked by At

I am trying to run the 'npm run serve' command in Visual Studio Code's integrated terminal on my Windows machine. However, I am encountering an issue where I am receiving an error that states: npm : Unable to recognize "npm" as a cmdlet, function, script file, or executable program. Please check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Now I'm uncertain of how to proceed. Here are the version details of my environment:

Operating System: Windows 10 Node.js Version: v20.11.1 npm Version: 10.2.4 Visual Studio Code Version: 1.87.1

What could be the problem and how can I fix it?

I have verified that Node.js and npm are both installed. Checking with 'node -v' and 'npm -v' in the terminal outside of VSCode return the version numbers as expected. The issue seems to be specific to the VSCode environment.Also, I've tried to run PowerShell as an administrator, and add the path to Node.js and npm to my system PATH manually.

Any help is greatly appreciated. Thanks in advance.

0

There are 0 best solutions below