How to remove all node_modules folders in linux

In this article let’s discuss about How to remove all node_modules folders in linux. Let’s go through the following methods without any delay.

Method 1:

find . -name "node_modules" -type d -prune -exec rm -rf '{}' +

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

npx npmkill
//hit space bar to confirm

Hope the above solution works.

Realted Posts : How to install yup in vue