m WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
时间: 2023-07-30 15:04:13 浏览: 93
location.replace
根据引用\[1\]和引用\[2\]的内容,当出现npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.的提示时,可以通过修改两个文件中的"prefix -g"为"prefix --location=global"来解决这个问题。具体步骤如下:打开nodejs文件夹,找到npm.cmd和npm两个文件,然后将这两个文件中的"prefix -g"替换为"prefix --location=global"。如果没有修改权限,可以在文件属性中进行修改。修改完之后,关闭之前的命令行窗口,重新打开一个新的命令行窗口,然后检查是否问题已解决。
#### 引用[.reference_title]
- *1* [解决:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.](https://blog.csdn.net/qq_35913301/article/details/125394027)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案](https://blog.csdn.net/weixin_45771601/article/details/125263816)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文