当前位置:网站首页>npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
2022-07-31 05:53:00 【m0_67401499】
Today I got a new computer to configure the environment. I have to go through the installation of node again. I still remember that when I installed node for the first time, it was full of mistakes. Windows was too pitiful. This time I encountered a newQuestion
npm WARN config global --global, --local are deprecated. Use --location
After installation, when I npm -v to check the version number, I got this error, and then I will record my solution
First of all, let's talk about installation
Download the corresponding version on the official website
Click here to go to the official website
Then click on the installation package and go all the way to next (fool installation)
After the installation is successful, open the cmd window to check the version number (node has integrated npm, so there is no need to install npm separately)
node -vnpm -vThere was an error when checking the version number here
Solution:
- Open the nodejs folder.and open two files npm.cmd and npm

- Find the prefix -g in those 2 files and replace it with prefix --location=global


It may not be available when first openedTo modify the permissions, just change it in the properties. - After modification, close the previous command line window.Reopen a new command line window and check it out.
This time you can use it normally!!!
边栏推荐
猜你喜欢

继承、Super,重写、抽象类、抽象方法 1(第七天)
![[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version](/img/7e/1d27e3f1856ab8c6cbfc5221c717bb.png)
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version
![[uiautomation] Get WeChat friend list (stored in txt)](/img/26/1f3424c5998c52c6e10ced8529012a.png)
[uiautomation] Get WeChat friend list (stored in txt)

Error: Cannot find module ‘D:\Application\nodejs\node_modules\npm\bin\npm-cli.js‘

GUCCI, LV and other luxury giant universe how to layout yuan, other brands should keep up with?

MySQL压缩包方式安装,傻瓜式教学

Linux修改MySQL数据库密码

vulhub靶场学习日记SickOs1.2

04 【计算属性 侦听属性】

Redis:安装使用
随机推荐
Using IIS10 to build an asp website in win11
MySQL高级语句(一)
12 【网页布局总结 元素的显示与隐藏】
DeFi Token in the project management
初涉C语言
[Elastic-Job] Overview of Distributed Scheduling Tasks
为什么redis是单线程还那么快?
win11中利用IIS10搭建asp网站
MySQL-如何分库分表?一看就懂
代码块、Package,Import,封装(第六天)
闭包(三)----执行环境
【云原生】微服务Nacos的简单介绍与使用
2021面经-拥抱变化
变量的解构赋值
leetcode-每日一题1252. 奇数值单元格的数目(模拟优化)
vulhub靶场学习日记xxe-lab
闭包(五)----一个常见的循环
leetcode-每日一题565. 数组嵌套(标记图和并查集)
一文速学-玩转MySQL获取时间、格式转换各类操作方法详解
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r