Prompt using node command: 'node' is not recognized as an internal or external command, operable program

Error: Use the node command prompt: 'node' is not an internal or external command, nor is it a runnable program

Reason: Node.js is not installed or environment variables are not configured properly

Case 1: Install node.js:

Download .msithe file : Node.js Chinese website (nodejs.cn)

Step 1: After the download is complete, double-click the installation package to start the installation

Step 2: Check the option to accept the agreement and click the next button

 

Step 3: The default installation directory of Node.js is "C:\Program Files\nodejs\", you can modify the directory and click next

Step 4: Click the tree icon to select the installation mode you need, then click next (next)

 

Step 5: Click Install to start installing Node.js. You can also click Back to modify the previous configuration. Then and click next (next step)

 

Click the Finish button to exit the installation wizard.

Check whether the PATH environment variable is configured with Node.js, click Start - Run - enter "cmd" - enter the command "path", the output contains the custom installation path of node.js in my computer D:\develop \nodejs\ : (The default installation path is C:\Program Files\nodejs\)

PATH=D:\develop\Java\jdk1.8.0_181\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;
C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\develop\Maven\apache-maven-3.6.3\bin;C:\Program Files (x86)\Yarn\bin\;
D:\develop\nodejs\;
D:\develop\Git\cmd;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Users\slyhc\AppData\Local\Yarn\bin;C:\Users\slyhc\AppData\Roaming\npm

To check the Node.js version, enter the command in cmd:

node --version

When the version number appears, the installation is successful:


Case 2: Environment variables are not configured properly

Right-click on this computer, click Properties-Advanced System Settings-Environment Variables-check whether the path variable is added to the node file path, my node installation path is D:\develop\nodejs\, this has already been added.

If the node path is not added to the path variable, find the location of your own node folder, copy the path and paste it into the path variable in the above steps:

Guess you like

Origin blog.csdn.net/weixin_51909882/article/details/125874593