An error occurred after installing node in win10: npm WARN config global `--global`, `--local` are deprecated. Use `--location=global`

question

After installing node on the win10 system, I npm -vfound an error: npm WARN config global --global, --localare deprecated. Use--location=global

Download the installation package from the node official website
Insert image description here
Insert image description here
: double-click the installation package to prompt the operation to install node, and npm -van error will be reported when running, as shown below:
Insert image description here

solution

Find two files in the node installation directory: npm and npm.cm. The
Insert image description here
found prefix -gplace is modified to: prefix --location=global
Insert image description here
Insert image description here
At this point, execute the view command again, perfect solution~
Insert image description here
ps : I use notepad++ to directly open and modify the saved file, and open it with another editor. It may be impossible to modify the saved file directly. You can make a copy first and then replace the original file.

Guess you like

Origin blog.csdn.net/ganyingxie123456/article/details/126273570
Recommended