Clean up your Meteor package cache!

As you may know, Meteor stores downloaded Atmosphere packages in a cache in your user directory (~/.meteor/packages). However, the longer you use Meteor, the more packages and package updates are downloaded and the larger this cache will get because Meteor doesn’t remove old or unused packages (yet). There is a request for this feature but until it’s implemented in the Meteor tool, you can use my meteor-cleaner npm package to remove unused packages and free up (a lot of) disk space! :slight_smile:

After installing it with meteor npm install -g meteor-cleaner, clean-package-cache can be used like a built-in Meteor command:

meteor clean-package-cache [options]

Windows is currently not supported!

See the package README.md for details and an explanation of the options.

The advantange of clean-package-cache over just removing ~/.meteor/packages is that you have more control over which packages are removed. For example, you can run meteor clean-package-cache --keep-scanned ~/Projects to scan all Meteor projects in the ~/Projects directory and its subdirectories and remove only those packages that aren’t used in your projects.

34 Likes

This is awesome, thank you

If I didn’t need 20 characters, a single word would do:

Briljant! Thanks.

:raised_hands::smile:

6 Likes

i am running out of disk space constantly, but now i get another 8 gigs freed!

made my day, thank you so much!!!

2 Likes

have you thought about just submitting a PR with your work to the Meteor tool?

3 Likes

And another 8 Gigs saved. Thanks so much!

2 Likes

8 gigs for me too. Seems to be kinda the default value :slight_smile:

2 Likes

This is fantastic. I can’t thank you enough. My almost-full drive is now 20 Gb lighter.

I had no idea how big those package caches had grown.

2 Likes

I have, but I think the preferred solution for the Meteor tool is to remove packages automatically, depending on how frequently they are used. Ideally, the cache would always have a reasonable size and you wouldn’t have to run a command manually every once in a while. :slight_smile:

1 Like

Update

There was a bug in the initial release that could lead to the removal of the currently used meteor-tool package. In this case, you would get the error message '[...]/.meteor' exists, but '[...]/.meteor/meteor' is not executable. when running meteor. The bug is fixed in version 1.0.1 but you have to reinstall Meteor with curl https://install.meteor.com/ | sh.

To update to the latest meteor-cleaner version, run meteor npm install -g meteor-cleaner.

Sorry for the inconvenience!

2 Likes

just saw this error and came here to go to github to file an issue and there it is, the fix. Thanks for the update :handshake:

1 Like

thanks :slight_smile: I ran into the issue, solution was just to run the Meteor installer script again (curl https://install.meteor.com/ | sh) to get the binary back

1 Like

Awesome! :smile: Great Job!

can’t you just periodically delete your bundle cache? I just run OmniDiskSweeper and go to my meteor folder

Meteor removes old files from the bundler cache automatically since version 1.5. :slight_smile:

2 Likes

11 gigs being freed :slight_smile:

1 Like