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
benjaminv profile image
benjaminv

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

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
mpetuska 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