npm报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

简介: npm报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.


一、前言

1.问题

node.js安装后,执行npm报错WARN

2.投石探路

百度了一些后,初步判断是node.js版本问题,但因为看其他人的一些文章,尝试过后没啥效果;终于在其中一篇找到了解决方案

二、解决

1,打开node.js安装目录那里,找到npm.cmd文件

2,右击 -> 打开方式 ’ 记事本’

3,将文件里的 prefix-g 改为 prefix --location=global

4,点击保存就解决了

5,控制台尝试一下输入,没有npm报错,说明解决了

目录
相关文章
|
5天前
|
JavaScript
npm install 报错 import sys; print“%s.%s.%s”% sys.version_info[ :3] ;
npm install 报错 import sys; print“%s.%s.%s”% sys.version_info[ :3] ;
11 3
|
7天前
|
开发工具 git
*** Please tell me who you are.Run git config --global user.email “you@example.com“ git confi
*** Please tell me who you are.Run git config --global user.email “you@example.com“ git confi
|
23天前
|
JavaScript
vue npm启动报错-解决
vue npm启动报错-解决
18 4
|
23天前
|
资源调度
npm yarn 启动报错【已解决】
npm yarn 启动报错【已解决】
24 2
|
9天前
|
JavaScript
蓝易云 - npm install报错问题解决合集
以上是一些常见的npm install错误及其解决方法,希望对你有所帮助。
9 0
|
1月前
|
PHP
php 使用phpize报错Cannot find config.m4. Make sure that you run ‘/usr/bin/phpize‘ in the top l
php 使用phpize报错Cannot find config.m4. Make sure that you run ‘/usr/bin/phpize‘ in the top l
34 1
|
12天前
|
PHP 数据库
phpMyAdmin报错 in ./libraries/config/FormDisplay.php#661 continue targeting switch is equivalent to
phpMyAdmin报错 in ./libraries/config/FormDisplay.php#661 continue targeting switch is equivalent to
8 0
|
16天前
|
缓存
npm install 安装依赖报错解决
npm install 安装依赖报错解决
28 0
|
2月前
|
安全 网络安全 数据安全/隐私保护
/etc/ssh/sshd_config line 142: Deprecated option RSAAuthentication 是什么
【5月更文挑战第6天】/etc/ssh/sshd_config line 142: Deprecated option RSAAuthentication 是什么
284 4
|
2月前
npm报错:npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED,npm ERR! npm ERR! If you are behind a
npm报错:npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED,npm ERR! npm ERR! If you are behind a

推荐镜像

更多