The node is installed on the d drive. After nodemon is installed, enter nodemon -v in the command window and the prompt is not an internal command or an external command

table of Contents

Preface

The node is installed on the d drive. After nodemon is installed, enter nodemon -v in the command window and the prompt is not an internal command or an external command

First, click here for your carelessness
to solve the case where nodejs is installed on the d drive instead of the c drive.

solution

When node.js was installed, the npm path was not modified, which caused it to run

npm i -g nodemon

nodemon is not installed under node.js, after global installation, you can check whether node_cache and node_global are empty in the following file
Insert picture description here

If it is empty, the download path of npm is not configured. At this time, we need to configure the specified download path. At the command terminal, enter the following two commands

npm config set prefix “D:\Program Files\nodejs\node_cache”
npm config set cache “D:\Program Files\nodejs\node_global”

After configuration, install it globally again. At this time, you will find the nodemon.cmd file under node_global, as shown below
Insert picture description here

Then congratulations, nodemon has been successfully installed

When you run nodemon with full confidence, you find that the prompt is neither an internal command nor an external command.
At this time, you only need to configure the environment variables.

Right-click on the computer "Properties" Advanced Environment Variables "Environment Variables
Insert picture description here
are added in path

D:\Program Files\nodejs\node_global

After the environment is configured, go to cmd—> nodemon --v

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43236062/article/details/108886061
Recommended