当前位置:网站首页>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
边栏推荐
- Remote—基本原理介绍
- Test cases and defect report templates
- 【网络教程】IPtables官方教程--学习笔记2
- Character function and string function (2)
- Use of C log4net: add file name and line number to the output log content; Repackaged class output file name and line number
- Explain in detail the principle of MySQL master-slave replication "suggestions collection"
- MySQL master-slave replication data synchronization, summary of common problems
- kali修改更新源(无法安全的用该源更新)
- LeetCode通关:哈希表六连,这个还真有点简单
- [MCU] 51 MCU burning those things
猜你喜欢

Leetcode skimming -- guess the size of numbers II 375 medium

Leetcode-6125: equal row and column pairs

LeetCode通关:哈希表六连,这个还真有点简单

Leetcode-919: complete binary tree inserter

Basic knowledge of Marine Geology

leetcode-919:完全二叉树插入器

ROS_ Rqt toolbox

Success factors of software R & D effectiveness measurement

Leetcode-114: expand binary tree into linked list

Leetcode-6129: number of all 0 subarrays
随机推荐
How to obtain the subordinate / annotation information of KEGG channel
Jmeter分布式压测
文件操作详解
Brush questions with binary tree (4)
leetcode-6131:不可能得到的最短骰子序列
matlab----EEGLab查看脑电信号
测试用例和缺陷报告模板
Online random coin tossing positive and negative statistical tool
DDD的Go实战
KEGG通路的从属/注释信息如何获取
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
Leetcode-155: minimum stack
Cesium polygon gradient texture (canvas)
Unity vs -- the default debugging in VS is to start rather than attach to unity debugging
[MCU] 51 MCU burning those things
租房二三事
Leetcode-6129: number of all 0 subarrays
Card link
preprocessor directives
MySQL master-slave replication data synchronization, summary of common problems