How to clean node_modules folder packages that are not in Package.json

How to clean node_modules folder packages that are not in Package.json

In this post we will give you information about How to clean node_modules folder packages that are not in Package.json. Hear we will give you detail about How to clean node_modules folder packages that are not in Package.jsonAnd how to use it also give you demo for it if it is necessary.

we are going to learn about how to clean the extra packages in a node_modules folder that are not present in the package.json file using npm.

Cleaning node_modules folder packages

To remove the node_modules folder packages that are not present in the package.json file, we can use the npm prune command followed by the package name.

Here is an example, that removes the express package from the node_modules folder.

npm prune express

for removing multiple packages use:

npm prune express cors

Second way

We can also remove the extra packages by deleting the node_modules folder and reinstall it using the npm uninstall command.

Hope this code and post will helped you for implement How to clean node_modules folder packages that are not in Package.json. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US