当前位置:网站首页>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
边栏推荐
- Deep Non-Local Kalman Network for VideoCompression Artifact Reduction
- Union, the difference between union and structure, the knowledge of enumeration of C language corners
- 深入浅出富文本编辑器
- MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
- (7/29) Basic board minimum spanning tree prim+kruskal
- Automatically generate test modules using JUnit4 and JUnitGenerator V2.0 in IDEA
- [Machine Learning] The Beauty of Mathematics Behind Gradient Descent
- MySQL 用户授权
- GPGGA NTRIP RTCM Notes
- MySQL Soul 16 Questions, How Many Questions Can You Last?
猜你喜欢
随机推荐
这本记述40年前历史的游戏书,预言的却是当下的事
数据质量提升
ValueError: Append mode is not supported with xlsxwriter解决方案
Redis数据更新,是先更新数据库还是先更新缓存?
KingbaseES V8R6备份恢复案例之---同一数据库创建不同stanza备份
openim支持十万超级大群
ClickHouse删除数据之delete问题详解
C语言犄角旮旯的知识之结构体
openim支持十万超级大群
Typescript 严格模式有多严格?
微信公众号授权登录后报redirect_uri参数错误的问题
Apache DolphinScheduler新一代分布式工作流任务调度平台实战-上
Google Earth Engine ——快速实现MODIS影像NDVI动画的在线加载并导出
kubernetes
Day 16 of HCIP
MySQL分页查询的5种方法
【网络安全专栏目录】--企鹅专栏导航
Oracle ADG状态查看与相关视图
JSESSIONID description in cookie
手动从0搭建ABP框架-ABP官方完整解决方案和手动搭建简化解决方案实践








