当前位置:网站首页>Solve npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead
Solve npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead
2022-07-30 21:32:00 【m0_67394230】
When installing and configuring node, cmd checks node no problem

But when checking npm, **npm warn config global `–global`, `–local` are deprecated. use `–location=global` instead.** alarm

The problem occurs in that the command of the previous version of npm is usually XXX -g, but with the change of version, this old method is deprecated. At this time
- We need to modify two files npm and npm.cmd

Modify the line 23 of the npm file to the following style, the command is as follows, you can paste it directly
prefix --location=global
Modify the line 12 of the npm.cmd file to the style shown in the figure below. The command is as follows, you can paste it directly, and save it after modification.
prefix --location=global
2. At this point, reopen cmd, and npm -v will not report an error (if it still reports an error, you can try restarting the computer, there is nothing that cannot be solved by restarting, haha)
However, When using some common npm commands, using XXX -g will still report an error, this is because the high version -g command has been deprecated, so the existing method XXX should be used–location=global
In fact, the content of the error tells us that npm WARN configures the global '--global', and '--local' is deprecated.
Use "--location=global" instead.
For example: To install common express modules, you should use the following command line
npm install express -gnpm install express --location=global //Install common express modulesFinally, take viewing the root directory as an example to demonstrate the command

Solve the problem and finish the flower ````~~~~~
Let me introduce myself first. The editor graduated from Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢

GPGGA NTRIP RTCM 笔记

Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’

【菜鸡含泪总结】如何用pip、anaconda安装库

系统结构考点之多级混洗交换网络

Day 16 of HCIP

用于视频压缩伪影消除的深度卡尔曼滤波网络

8 ways to get element attributes in JS

MySQL60题作业

数字货币期货现货交易技巧,把握关键进场的买入点!(纯干货)

LeetCode · 23. Merge K ascending linked lists · recursion · iteration
随机推荐
DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNs for Soft Decoding of JPEG-Compressed Images
解决centos8 MySQL密码问题ERROR 1820 (HY000) You must reset your password using ALTER USER
外包干了三年,废了...
【信息安全技术】RSA算法的研究及不同优化策略的比较
KingbaseESV8R6 snapshot too old的配置和测试
Niu Ke Xiaobaiyue Race 53 A-E
新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行
nVisual网络可视化管理平台功能和价值点
关于SFML Rect.inl文件报错的问题
MySQL笔记2(函数,约束,多表查询,事务)
[Deep Learning] Understanding of Domain Adaptation in Transfer Learning and Introduction of 3 Techniques
Teach you how to build a permanently running personal server
【零代码工具】15 款企业级零代码开发平台推荐,总有一款是你心仪的
Google Earth Engine ——快速实现MODIS影像NDVI动画的在线加载并导出
类似 MS Project 的项目管理工具有哪些
Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’
转义字符笔记记录
IDEA2018.3.5 cancel double-click Shift shortcut
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-上
C语言犄角旮旯的知识之结构体