当前位置:网站首页>Solve the error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.

Solve the error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.

2022-07-08 01:14:00 Lemon summer white

Have nothing to do to reconfigure the front-end environment , After downloading Node.js Check whether the installation is successful , Command line :node -v , npm -v, Judgment for Node.js The version is too high , Error reporting diagram below :
 Insert picture description here

Solution :
1. find Node.js Install under directory npm.cmd Script files , Open and edit in Notepad ;
 Insert picture description here


2. The part circled in yellow , file prefix-g Change it to prefix --location=global, Save after editing ;
 Insert picture description here


3. Rerun the command line npm -v that will do .

 Insert picture description here

原网站

版权声明
本文为[Lemon summer white]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/189/202207072320108441.html