Assume I install project packages with npm install
that looks into package.json
for modules to be installed. After a while I see that I don't need some specific module and remove its dependency from package.json
. Then I remove some other modules from package.json
because they are not needed anymore and others are replaced with alternatives.
Now I want to clean node_modules
folder so that only modules listed in package.json
stay there and the rest must go, something like npm clean
. I know I can remove them manually but would like to have some nice ready to use sugar functionality for that.
node_modules
, otherwise npm will re-evaluate the package.json and gives you the latest package versions, which with package that does not follow semver properly can become a nightmare