Home > Web Front-end > Front-end Q&A > What should I do if cmd shows that node is not an internal command?

What should I do if cmd shows that node is not an internal command?

藏色散人
Release: 2021-12-16 14:29:05
Original
5931 people have browsed it

cmd shows that node is not an internal command. Solution: 1. Set the nodejs installation directory path into the system variable or user variable; 2. Restart the cmd window and enter "node -v" in the command window to view the version. Just number.

What should I do if cmd shows that node is not an internal command?

The operating environment of this article: windows7 system, nodejs10.16.2 version, Dell G3 computer.

What should I do if cmd shows that node is not an internal command?

cmd prompts 'node' is not an internal or external command, nor is it an operable program. Solution

Error condition:

When running the node -xxx command in the cmd window, the prompt 'node' is not an internal or external command, nor an operable program or batch file

Cause:

The environment variables are not configured correctly.

In fact, my situation is that it is not configured at all...The default location was changed during installation. This problem occurred when node -v was used, and environment variables need to be configured

Configuring environment variables :

(The installation path of my node.js is F:\Download\nodejs. When modifying the environment variables, just modify them according to your own installation directory)

windows system Here, you need to set the nodejs installation directory path into the system variable or user variable

1. Open the Control Panel->System and Security->System->Advanced System Settings->Environment Variables

If nodejs is in the user directory, both NODE_PATH and PATH are set in user variables

2. Find variables in "User Variables" or "System Variables" PATH and add node.js folder path as value. Usually it is C:\Program Files\nodejs;. If the variable does not exist, it is created.

Create variables: Take the variable I created as an example, create a new one in the user variable, enter the variable name - NODE_PATH, enter the value - F:\Download\nodejs, if there is no PATH variable in the user variable, create a new one PATH variable, the value is %NODE_PATH%, if there is one, just add the value

3.win R: Restart the cmd window (enter cmd after win R to open the command window), enter node -v in the command window Check the version number. If you can check the environment variable configuration is successful

Recommended study: "node.js Video Tutorial"

The above is the detailed content of What should I do if cmd shows that node is not an internal command?. 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