The problem leads to:
When executing the npm install command in VS Code, it reported "'npm' is not an internal or external command, nor is it an operable program or batch process. file" error.
Solution:
First check whether the environment variables are configured properly:
In the system variable NODE_PATH, the variable value is the installation path of nodejs.
User variable Path contains %NODE_PATH%
If the command line opened through CMD can execute node -v and npm-v, but it's not recognized in VS Code. Then there may be two situations:
1. VS Code is running when configuring environment variables.
VS Code does not dynamically refresh environment variables and needs to be restarted to recognize npm commands.
2. Insufficient permissions.
You can try running VS Code as an administrator. (This should be the case here)
Related tutorial sharing: vscode tutorial
The above is the detailed content of vscode does not recognize node command. For more information, please follow other related articles on the PHP Chinese website!