DEV Community

Discussion on: Delete Node Modules like a PRO 😎

Collapse
 
manjit2003 profile image
Manjit Pardeshi

rm -rf node-modules does the job too

Collapse
 
shinigami92 profile image
Shinigami

npx npkill can recursively traverse your directories
So you can use it from e.g. your HOME folder and then remove every unnecessary node_modules in every directory/project

Collapse
 
petuska profile image
Martynas Petuška

So can rm -rf **/node_modules

Thread Thread
 
shinigami92 profile image
Shinigami

This will remove everything without any control

With npkill you can select each node_modules individually

Try it and you will see what I mean

Collapse
 
devyoma profile image
Emore Ogheneyoma Lawrence

does it delete all the node_modules in the directory? No it doesn't

Collapse
 
benjaminv profile image
benjaminv

No it does not :-). It is rm -rf node_modules does

Collapse
 
rohit_munde profile image
Rohit Munde

rm -r node-modules this should work