Trong Lam Phan Trong Lam Phan - 3 months ago 12
JSON Question

Npm remove all packages that no more exist in package.json

I'd like to remove all packages (in node_modules) that no more exist in package.json (these packages' name have been removed by another developer and the package.json file is modified on git).

How can i do that ?

Thanks !

Answer

Use following command:

npm prune

Description can be found here