当前位置:网站首页>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 modules
Finally, 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
边栏推荐
猜你喜欢
Image Restoration by Estimating Frequency Distribution of Local Patches
解决npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead
Navigation Bar----Personal Center Dropdown
【网络安全专栏目录】--企鹅专栏导航
【信息安全技术】RSA算法的研究及不同优化策略的比较
DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNs for Soft Decoding of JPEG-Compressed Images
Deep Non-Local Kalman Network for VideoCompression Artifact Reduction
Why do so many people who teach themselves software testing give up later...
Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’
Quick Master QML Chapter 6 Animation
随机推荐
GPGGA NTRIP RTCM Notes
C语言犄角旮旯的知识之结构体
openim支持十万超级大群
数据指标口径不统一、重复开发?亿信ABI指标管理平台帮你解决
(7/29) Basic board minimum spanning tree prim+kruskal
3分钟带你了解微信小程序开发
系统结构考点之PM2I单级网络
Knowledge of C language corners of byte alignment
JDBC (detailed explanation)
ValueError: Append mode is not supported with xlsxwriter解决方案
tcp协议传输中的粘包问题
Typescript 严格模式有多严格?
大家都在用的plm项目管理软件有哪些
ML.NET相关资源整理
数据质量提升
JUC原子类详解
Markdown的使用
【Nacos】解决Nacos下载速度缓慢的问题
Motion Tuned Spatio-temporal Quality Assessmentof Natural Videos
系统结构考点之并行主存