question
After installing node on the win10 system, I npm -v
found an error: npm WARN config global --global
, --local
are deprecated. Use--location=global
Download the installation package from the node official website
: double-click the installation package to prompt the operation to install node, and npm -v
an error will be reported when running, as shown below:
solution
Find two files in the node installation directory: npm and npm.cm. The
found prefix -g
place is modified to: prefix --location=global
At this point, execute the view command again, perfect solution~
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.