简体   繁体   中英

Why does 'npm install' remove my installed packages in angular cli?

The npm install [package] command is removing other packages previously installed.

If I run npm install [package b] , it will install package b but remove package a. This occurs vice versa with other packages.

This happens when install the ng-bootstrap dependency using the following command npm install --save @ng-bootstrap/ng-bootstrap and later install the following dependency npm install ng2-ion-range-slider --save , in this case ng-bootstrap dependency is removed of my node_modules . My questions is why this happens? What is the explanation of this strange behavior?

In my case it happened due to outdated package-lock.json (it was not commited to git after latest package.json change).

Solution : do plain npm i to fix your package-lock.json

After this npm i [packages] should work as expected

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM