npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead


1. Problem background

When using the npm -v command, the following error is prompted npm WARN config global –global , –local are deprecated. Use–location=global instead
Insert image description here

2. Cause of the problem

npm's global configuration --global, --localdeprecated. Substitution is required --location=global.

3. Problem handling

1. Find the installation path of node

If you forget the installation path, you can enter it in the cmd window where nodeto view the path.
Insert image description here

2. Modify npm, npm.cmd file

Insert image description hereModify the file prefix -gand prefix --location=global
Insert image description hereInsert image description hereview it with npm -v after the modification is completed.
Insert image description here

Guess you like

Origin blog.csdn.net/hsuehgw/article/details/129001870