Rid Yourself Of Node Modules

preview_player
Показать описание
Two commands that will help you clean your drive of this mass of node_modules directories you have lying around.

#shorts
Рекомендации по теме
Комментарии
Автор

I actually ran this tool when I used npm.
It showed 3gb.
And now with pnpm, it has improved (946mb)

Dev-Siri
Автор

pro tip: npx npkill is also usable in Windows and is *significantly* faster than using windows explorer for this kind of work.

PhilipAlexanderHassialis
Автор

Thanks, Jack! 6.6 GBs freed up lol, all in a directory with ~40 small projects. The comment about this working very quickly in Windows is spot on. Manually deleting node_modules always takes forever, but this took less than 5 minutes :D

ivanolmo
Автор

Thanks! I knew about this one but it doesn't hurt to see it again.

JGBSolutions
Автор

rm -rf very danger command always use carefully. npx npkill is awesome thanks for sharing this.

SanjuKumar-hkyy
Автор

Just cleared 30GB of space on my mac. Thanks for that tip :)

Kermin
Автор

This is so awesome! Thank you for sharing!

matthewvaden
Автор

Actually after deleting you have to enter “q” in the active shell and not “ESC”.

RealEstateD
Автор

I really love your content Jack thank you so much

oscardasilva
Автор

cool tip, was using that rm -fr so far, as always awesome content.

RishiKasyap
Автор

I was literally looking for a way to delete all the node modules folders. I was thinking write a node js program to do this. Didn't know it was this simple.

Getentertainedp
Автор

This was. an awesome find. Saved me 12GB plus.

sheldonsays
Автор

Oooo I'm gonna try this. Thx !!!😊

kohelet
Автор

Very cool. Will save me a ton of space.

nitinupadhyay
Автор

Recently deleted 16+ gb 😂 should have known about this one 😅

Stoney_Eagle
Автор

Nice way to break all the electron apps on your computer.

Thorax
Автор

Using -fr instead of -rf triggered me

A colleague of mine has once recommended an NPM utility called "f*ck-npm" (put in the missing letter). All it does is it deletes node_modules and reinstalls your dependencies.
And if you bash your keyboard in frustration, it will also delete the package-lock. Pretty useful when you are doing difficult dependency changes and things break a lot.

phoenix-tt
Автор

Thanks as always! Also, I was wondering which extension you are using for command line selection? I really want that!

story_of_us_
Автор

One time I deleted around 30 gigabytes

austincodes
Автор

Why is there not a singular node modules directory for all your projects since repos dont store the directories and a pipeline build will reconstruct it from the package.json?

avalerionbass