当前位置:网站首页>NPM module removal_ [solved] after NPM uninstalls the module, the module is not removed from package.json [easy to understand]
NPM module removal_ [solved] after NPM uninstalls the module, the module is not removed from package.json [easy to understand]
2022-07-25 20:58:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Toss about :
period , There is a strange phenomenon :
use npm remove xxx or npm uninstall xxx after
xxx Not from package.json Removing the :* HeadquarterReport git:(permission-control) * npm remove element-ui
– [email protected] node_modules/async-validator
– [email protected] node_modules/babel-helper-vue-jsx-merge-props
– [email protected] node_modules/deepmerge
– [email protected] node_modules/throttle-debounce
– [email protected] node_modules/element-ui
npm WARN [email protected] No repository field.
Results found :
package.json
Configuration in :
“element-ui”: “1.4.3”,
Did not actively delete :
So install a new :* HeadquarterReport git:(permission-control) * npm install element-ui
[email protected] /Users/crifan/dev/dev_root/xxx
npm WARN [email protected] No repository field.
The results are 1.4.3
after npm uninstall package.json not update
Seems to add :-S, –save Parameters can be updated package.json?
-》 No parameters have been added before , Why can I update ?
Try again :* HeadquarterReport git:(permission-control) * npm uninstall element-ui -S
npm WARN [email protected] No repository field.
Sure enough, it's really updated package.json, Removed element-ui 了 .
【 summary 】
npm uninstall/remove xxx
It cannot be automatically updated package.json, hold xxx from
dependencies
devDependencies
optionalDependencies
Removing the .
Only by adding corresponding parameters :-S, –save:dependencies
-D, –save-dev:devDependencies
-O, –save-optional:optionalDependencies
such as :
npm uninstall element-ui -S
You can uninstall element-ui At the same time , Take it from dependencies Deleted from .
【 Postscript 】
Later adopted npm install when , It turns out that there is no update package.json:* HeadquarterReport git:(permission-control) * npm install element-ui
[email protected] /Users/crifan/dev/xxxx
npm WARN [email protected] requires a peer of [email protected]^2.5.2 but none was installed.
npm WARN [email protected] No repository field.
Didn't put element-ui add .
after npm install package.json not update
It seems that parameters must also be added , Can only be ?
Then try again :* HeadquarterReport git:(permission-control) * npm install element-ui –save
[email protected] /Users/crifan/dev/xxx
npm WARN [email protected] requires a peer of [email protected]^2.5.2 but none was installed.
npm WARN [email protected] No repository field.
Sure enough package.json It's been updated ,dependencies Combined with the :
“element-ui”: “^2.0.1”,
【 summary 2】
Seems to be :
npm install/uninstall xxx yes , It's just installation / Uninstall the corresponding module
Just add :
–save
–save-dev
Equal parameter , Only then can the corresponding module version be required , Add to / Delete the package.json in .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/127685.html Link to the original text :https://javaforall.cn
边栏推荐
- leetcode-6131:不可能得到的最短骰子序列
- 【FiddlerTX插件】使用Fiddler抓包腾讯课堂视频下载(抓不到包解决方案)
- Detailed explanation of document operation
- MPI学习笔记(二):矩阵相乘的两种实现方法
- Jmeter分布式压测
- Pycharm跑程序时自动进入测试模式
- [matlab] download originality documents based on oil monkey script and MATLAB
- 两数,三数之和
- 文件操作详解
- Pychart automatically enters the test mode when running the program
猜你喜欢

leetcode-6129:全 0 子数组的数目

预处理指令

Canvas fill gradient

Too many passwords, don't know how to record? Why don't you write a password box applet yourself

preprocessor directives

matlab----EEGLab查看脑电信号

Cloud native, Intel arch and cloud native secret computing three sig online sharing! See you today | issues 32-34

两数,三数之和

Leetcode-919: complete binary tree inserter

Force deduction ----- calculate the money of the force deduction bank
随机推荐
Beisen Holdings' IPO: a total loss of 4.115 billion yuan in three years, and a total of 2.84 billion yuan in the previous nine rounds of financing
"Shallow in and shallow out" MySQL and InnoDB [it is recommended to collect and share]
Leetcode-146: LRU cache
Yolov7 training error indexerror: list index out of range
Leetcode-6127: number of high-quality pairs
The international summit osdi included Taobao system papers for the first time, and end cloud collaborative intelligence was recommended by the keynote speech of the conference
What's special about Huawei's innovative solutions to consolidate the foundation of ERP for small and medium-sized enterprises?
图片怎么存储到数据库里「建议收藏」
Test cases and defect report templates
Success factors of software R & D effectiveness measurement
【网络教程】IPtables官方教程--学习笔记2
An interview question about interface and implementation in golang
Golang language quickly get started to comprehensive practical notes (go language, beego framework, high concurrency chat room, crawler)
Qixin Jushi cloud spectrum new chapter | Haitai Fangyuan and Sichuan Unicom reach ecological strategic cooperation
Brush questions with binary tree (4)
[matlab] download originality documents based on oil monkey script and MATLAB
Niuke-top101-bm37
牛客-TOP101-BM37
103. (cesium chapter) cesium honeycomb diagram (square)
Product principles of non-financial decentralized application