I have to remove several libraries from the project. Currently worried about what if I remove a library, which is dependency of any other library.
Which approach can safely remove the libraries ?
I see I have two choices:
Edit package.json manually. Remove library entries... Delete node_modules folder and do npm install.
do npm uninstall --save for each package.
What are difference between two, especially when I want to take one step at a time. Without breaking any peer dependencies
There is no difference at all
npm un package_name package_name ....
will uninstalls a package, completely removing everything npm installed on its behalf
It also removes the package from the dependencies, devDependencies, optionalDependencies, and peerDependencies objects in your package.json and update package-lock.json file also
--save or -S will tell npm to remove the package from your package.json and package-lock.json files. This is the default, you don't have to use it.
--no-save is opposite to --save will tell npm not to remove but uninstall
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With