config global `--global`, `--local` are deprecated. Use `--location=global` instead. Debugger attached.
时间: 2023-10-08 13:11:51 浏览: 77
引用<span class="em">1</span>
#### 引用[.reference_title]
- *1* [global-modules:返回NPM用于全局安装的NPM软件包的目录](https://download.csdn.net/download/weixin_42136791/15016407)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
相关问题
npm WARN config global --global, --local are deprecated. Use --location=global instead.
该警告是因为在使用npm -v命令时,使用了已经弃用的--global和--local选项。现在应该使用--location=global选项来代替它们。要解决这个问题,可以按照以下步骤进行操作:
1. 找到node的安装路径。
2. 打开命令提示符或终端窗口,并输入以下命令:
```
npm config set location global
```
3. 运行上述命令后,再次运行npm -v命令,应该不会再出现警告信息了。
config global `--global`, `--local` are deprecated. Use `--location=global` instead.
问题的原因是由于最近使用npm时出现了报错信息"npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead." [1,这个报错信息通常是由于使用过时的命令导致的。常见的出现这个报错的原因是配置npm淘宝镜像时,使用了过时的命令。 解决这个问题的方法是通过修改node.js安装目录下的npm.cmd文件。打开该文件后,将其中的"prefix-g"改为"prefix --location=global",保存文件即可。 这样就可以避免出现这个报错信息了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [解决 npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.](https://blog.csdn.net/m0_49072553/article/details/127204821)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead处理办法](https://blog.csdn.net/hsuehgw/article/details/129001870)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [npm报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` ...](https://blog.csdn.net/weixin_48764380/article/details/125335629)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文