Home > Development Tools > VSCode > body text

How to add npm path to vscode

angryTom
Release: 2019-11-08 14:20:29
Original
4197 people have browsed it

How to add npm path to vscode

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!