"System Variables", and then edit the environment variables; 3. Find the location of nodejs folder; 4. Click "OK"."/> "System Variables", and then edit the environment variables; 3. Find the location of nodejs folder; 4. Click "OK".">

Home >Web Front-end >Front-end Q&A >What should I do if node cannot use npm command?

What should I do if node cannot use npm command?

藏色散人
藏色散人Original
2023-02-08 10:09:314590browse

Node cannot use the npm command because the environment variables are not configured correctly. The solution is: 1. Open "System Properties"; 2. Find "Environment Variables" -> "System Variables", and then edit the environment Variable; 3. Find the folder where nodejs is located; 4. Click "OK".

What should I do if node cannot use npm command?

The operating environment of this tutorial: Windows 10 system, node v14.16.0 version, DELL G3 computer

What can I do if node cannot use the npm command? manage?

The reason why node is successfully installed but npm cannot be used and the solution

As mentioned, Node is installed successfully, but npm cannot be used.

What should I do if node cannot use npm command?

Cause: The environment variables are not configured correctly.

Solution:

What should I do if node cannot use npm command?

What should I do if node cannot use npm command?

Find the folder where nodejs is located

What should I do if node cannot use npm command?

Let’s elaborate on the reason: I guess it may be because the nvm package management tool reuses the node module, so the node_modules folder in the node version downloaded with nvm is empty, as shown below:

What should I do if node cannot use npm command?

The 12.16.1 version I downloaded manually has content in node_modules, as shown below:

What should I do if node cannot use npm command?

Recommended learning: "node.js video tutorial"

The above is the detailed content of What should I do if node cannot use npm command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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