Ad

Remove Unused Modules

- 1 answer

Problem

I have created a react app that is currently 327.6 MB large. During development I got a little crazy with installing different modules. I want to streamline my app to remove all these unused node modules and packages. I know about npm prune but I don't completely understand how it works.

Ad

Answer

npm prune will remove modules not listed in package.json. To remove any specific node package, run the command npm prune package_name

For live-streaming ,If you want to get rid of the unused modules which are specified in devDependencies in package.json file, run this command.

npm prune --production

For more-

npm help prune

Ad
source: stackoverflow.com
Ad