Migrated from: meteor/meteor#6580
I was interested in implementing this, I agree with @abernix , measuring the size of the .meteor every 50th run or so, however the measuring itself is not yet decided how, well I would go with calling du on linux or using the dir command on windows using a child process, what do you guys think?
This makes a lot of sense, as .meteor can get incredibly large over time in my experience. I am not 100% sure what exactly meteor reset does, but either encourage the user to run it at that point or provide another cli method which cleans up the .meteor dir.
@Twisterking Just to be clear; this feature request is about the size of the .meteor directory in your home directory, not the .meteor directory in your application. meteor reset only impacts your app's .meteor directory (meteor reset removes all local data stored within that directory, including your local Mongo DB). With regards to the size of your app's .meteor directory, that issue should now be resolved via https://github.com/meteor/meteor/pull/8687.
How can I shrink the size of the global .meteor directory? Just remove files?
Maybe we should have an additional meteor command. meteor clean would clean anything locally, meteor clean --global would clean globally.
BTW, maybe meteor reset could also remove node_modules? And then reinstall them or something.
@matteodem You can just delete your entire [HOME_DIR]/.meteor directory. The next time you run meteor, it will download everything it needs.
Thanks for the clarification @hwillson.
Still I agree with @mitar that some new clean command would help. This of course should be a bit more sophisticated than just deleting [HOME_DIR]/.meteor but be more like deleting all the old, unused/cached versions of the packages and so on.
Knowing about this would have probably saved me from completely reinstalling my Ubuntu VM dev environment on my Windows host machine. My 16GB virtual drive got the "Too many inodes - disk full" message when building my app (after a few years of development). I just removed this folder on my Macbook Pro (it was 4.2GB) and it removed well over one million files. So this probably would have fixed the issue on my Ubuntu VM. This is an important issue.
Thanks @hwillson, helpful to know...
@evolross _only_ 4.2G? Pfft...
10:00 $ du -sh ~/.meteor
18G /Users/mike/.meteor
馃槷 explains a lot...
I would go with a meteor clean to delete the local .meteor -and maybe the node_modules folder too, and an option --global to remove the one at the [HOME_DIR]
meteor clean should be like make clean.
meteor clean discussion seems to be more relevant for #77. While this issue could be only about warning.
Just went ahead and deleted ~/.meteor folder on my MBP too. Finder started getting stuck and running on 150% cpu in activity monitor when indexing. Folder was 18gb and 2.2 million files inside, no wonder it was starting to cause problems on my computer. Having a warning about the size of the directory would be fantastic.
Quick side note - there is now a non-Meteor core tool that handles ~/.meteor cleaning; see https://github.com/klaussner/meteor-cleaner.
Most helpful comment
Quick side note - there is now a non-Meteor core tool that handles
~/.meteorcleaning; see https://github.com/klaussner/meteor-cleaner.