How to add the npm path to vscode
After installing Node.js, npm and other commands are invalid in vscode. How to solve the problem? Woolen cloth.
Solution:
The vscode terminal uses the system's cmd, so vscode cannot use the npm command. You need to first solve the problem that cmd cannot use npm.
If the downloaded zip package is decompressed, you must configure it into the system environment variables yourself.
For example, the nodejs folder is in D:\Nodejs, you need to add 'D:\NodeJs' to the Path variable. This configuration is mainly for node.exe, npm. cmd, if it is installed using the installation package, this step has been completed during the installation process.
Obviously I have downloaded node.js, but the npm command in vscode is invalid.
Because VScode is opened when the Node.js software package is installed, you think it may be because the VScode terminal does not detect the newly added environment variables in real time but only detects them when VScode is opened for initialization. It was caused once, so if you close VScode and reopen a VScode, you can use the commands included in the software package such as node -v and npm -v in the terminal.
Related recommendations: "vscode usage tutorial"
The above is the detailed content of How to add npm path to vscode. For more information, please follow other related articles on the PHP Chinese website!