DEV Community

Cover image for npkill - The solution to deleting node_modules easily, with style

npkill - The solution to deleting node_modules easily, with style

Carlos Caballero on August 08, 2019

Introduction One of my happiest memories related to software development was when I developed and distributed my first project among my ...
Collapse
 
nyagarcia profile image
Nya

Just published a patch. --delete-all should be fixed and working properly. If you encounter any more issues, don't hesitate to let me know and I will do my best to fix them. Thank you for your comment and your patience :D

Collapse
 
nyagarcia profile image
Nya

As you probably know already, using find/exec will delete every single result the command yields.
Npkill allows you to select which folders you want to erase, as well as calculating the amount of freed space... Without having to remember any lengthy commands :D

Collapse
 
sarbazx profile image
Taskhyn Maksim

used just now but didn't delet anything

Collapse
 
zaldih profile image
Juan

Hi taskhyn!

We believe it may be related to directory permissions. We will release a patch shortly that will notify the user about any errors related to permission problems.

Sorry for the inconvenience and thanks for trying npkill.

Collapse
 
carlillo profile image
Carlos Caballero

Hi @sarbazx !

What were your steps to run the tool?

Thanks!

Collapse
 
sarbazx profile image
Taskhyn Maksim

started by invoking command and then according to instruction pressed delete button or is it different key on mac?

Thread Thread
 
notpluto_ profile image
Srijan

Hi @sarbazx ! I am having trouble with the same. Did you managed to figure it out?

Thread Thread
 
sarbazx profile image
Taskhyn Maksim

Hi, no i was just testing it.

Thread Thread
 
nyagarcia profile image
Nya

Hey guys!

Just figured out I made a stupid mistake. Apparently the del keycode is different in mac, which is why it doesn't work (key is undefined). Will fix it right now!! So sorry!!

Thread Thread
 
carlillo profile image
Carlos Caballero

Hey @Nya!

Quiet and sure the patch is on its way :-).

Thank you very much for your app.

My MacBook wants to reduce the weight of the node_modules.

Cheer up!

Thanks!

Collapse
 
harken24 profile image
Jozo • Edited

It's not good practice to install NPM packages with sudo, I'd rather use npx command.
Of course correct me if I'm wrong.
But good job for developers it's a package I'll use definitely.

Collapse
 
carlillo profile image
Carlos Caballero

Totally true!

Collapse
 
th3n00bc0d3r profile image
Muhammad

Astonishing.. I'd say just one word...

Collapse
 
carlillo profile image
Carlos Caballero

Hi @th3n00brc0d3r!

They are very happy for their first open source project.

Thanks.

Collapse
 
webdevinci profile image
webdevinci

Well this helps a ton of things. Great share

Collapse
 
carlillo profile image
Carlos Caballero

Hi @webdevinci !

How many tons of gigabytes have you freed up?😂😂

Thanks!

Collapse
 
webdevinci profile image
webdevinci

I have 6.2 GB there (not too bad, not too good). I figure i can get rid of a 1/3 at least! It's a beautiful thing

Thread Thread
 
carlillo profile image
Carlos Caballero

Hi!

Really nice!

☺️

Collapse
 
justingivens profile image
Justin D. Givens

AWESOME tool!! Didn't realized I wasted over 10G of space on node_modules!

Feature suggestion: Row highlighting or something like that.

Collapse
 
nyagarcia profile image
Nya

Glad you found it useful! Great suggestion, will add it to the roadmap, thanks ;D

Collapse
 
codemouse92 profile image
Jason C. McDonald

Love the illustration, btw. ;)

Collapse
 
carlillo profile image
Carlos Caballero

Hi @codemouse92 ,

The logo has been created by them too.

Thanks!

Collapse
 
valeriopisapia profile image
Valerio

Thanks a lot, Mate :)

Collapse
 
omardulaimi profile image
Omar Dulaimi

This is really awesome, I still remember when I used to manually delete each node modules folder one by one. Great addition to the npm community indeed.

Collapse
 
duckbrain profile image
Jonathan Duck

Check out ncdu.

Collapse
 
carlillo profile image
Carlos Caballero

Hi!

Thanks!

Collapse
 
hmphu profile image
Phu Hoang

Awesome Jobs Guy!!!

Collapse
 
pabloc profile image
PabloC

On Mac just:

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

would do the same I think.

Collapse
 
lcfd profile image
Luca Fedrizzi

Cool idea! Thank you ❤️

Collapse
 
nyagarcia profile image
Nya

Oh no... will have to work on it. Thanks for letting us know 😊

Collapse
 
carlillo profile image
Carlos Caballero

Thanks!

The guys are working in improve the project. They are very happy cause that the tool is useful to the community (in my Linux works perfectly 😂)