当前位置:网站首页>npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
2022-07-31 05:53:00 【m0_67401499】
Today I got a new computer to configure the environment. I have to go through the installation of node again. I still remember that when I installed node for the first time, it was full of mistakes. Windows was too pitiful. This time I encountered a newQuestion
npm WARN config global --global
, --local
are deprecated. Use --location
After installation, when I npm -v
to check the version number, I got this error, and then I will record my solution
First of all, let's talk about installation
Download the corresponding version on the official website
Click here to go to the official website
Then click on the installation package and go all the way to next (fool installation)
After the installation is successful, open the cmd window to check the version number (node has integrated npm, so there is no need to install npm separately)
node -vnpm -v
There was an error when checking the version number here
Solution:
- Open the nodejs folder.and open two files npm.cmd and npm
- Find the prefix -g in those 2 files and replace it with prefix --location=global
It may not be available when first openedTo modify the permissions, just change it in the properties. - After modification, close the previous command line window.Reopen a new command line window and check it out.
This time you can use it normally!!!
边栏推荐
猜你喜欢
leetcode-每日一题1252. 奇数值单元格的数目(模拟优化)
NFT与数字藏品到底有何区别?
13 【代理配置 插槽】
gin框架学习-Casbin进阶之策略管理API使用方法
Using IIS10 to build an asp website in win11
leetcode-829. 连续整数求和(数论)
What is the difference between NFT and digital collection?
leetcode-每日一题873. 最长的斐波那契子序列的长度(哈希和二分)
uni-app进阶之创建组件/原生渲染【day9】
【Elastic-Job源码分析】——作业监听器
随机推荐
gin框架学习-Casbin进阶之策略管理API使用方法
What is an EVM Compatible Chain?
[Elastic-Job source code analysis] - job listener
16 【打包上线 图片懒加载】
mysql启动报错The server quit without updating PID file几种解决办法
为什么redis是单线程还那么快?
On the side of Ali, tell me what are the application scenarios of message middleware you know?
[Elastic-Job] Overview of Distributed Scheduling Tasks
永恒之蓝漏洞复现
NFT与数字藏品到底有何区别?
对于输出点是时间戳的渗透测试方法(以Oracle数据库为例)
DeFi 项目中的治理Token
对递归的一些感悟
2021 Mianjing - Embrace Change
碎片化NFT(Fractional NFT)
C language tutorial (1) - preparation
leetcode-每日一题731. 我的日程安排表 II
vulhub靶场学习日记hackme2
gin框架学习-Gin框架和Gorm框架搭建一个简单的API微服务
gin框架学习-JWT认证