Meteor tool and previous version cleanup

I am not sure if this has been discussed before, but having been playing/developing with meteor for almost 2 years, my $HOME/.meteor folder holds a lot of outdated “stuff”.

Recently I decided to blow away my .meteor folder and install it from scratch. Unfortunately, when entering and old project directory and just issuing meteor --version it downloads the meteor tool for that old version before even displaying it, loading my .meteor directory with cruft again.

What is the recommended way to clean out versions of meteor/packages no longer desired from the .meteor folder?

1 Like

Meteor has to download the appropriate version of the command line tool to run an old app. You can check what version an app is using without downloading the tool by reading the .meteor/release file directly.

1 Like

Argh, good to know about the .meteor/release but what to do about cleaning up $HOME/.meteor ?

Reinstalling Meteor will clear out that folder, and then it will only download things that you are using.

What’s the result you’re looking for? What do you mean by “cleaning up”?

I was looking for being able to selectively remove old meteor versions. Reinstalling seems like such a heavy handed approach, albeit in today’s high-speed internet world this might not be that bad.

The other problem is that when running meteor update it downloads the .meteor/release version first

 cat .meteor/release 
 meteor update
Installing Meteor 0.8.2:                      
 * 'meteor' build tool (version 858c88b520)

so I would have to blow away $HOME/.meteor after every upgrade …

Hmm, that’s kind of awkward. We haven’t been optimizing for disk space so far, but we could be a lot more cautious about downloading extra stuff when it isn’t needed. This will be particularly helpful for people with small hard drives and slow internet connections. You should report this as a feature request on GitHub!

I just wrote a small node program to allow to delete all the files belonging to a certain release. I put it in a gist. The script itself only prints the rm commands to stdout.

I am running a VirtualMachine with ony 20GB disk space (which I thought would be big enough). My meteor-tool directory is 8GB and I would like to reduce this size. Any way to do this?

Look into deleting your .meteor/local/bundler-cache directory and contents. See:

(EDIT: Just noticed you mentioned meteor-tools specifically, so this won’t help. Still, worth mentioning as that linker directory grows quite large over time…)

Anybody able to assist in reducing the .meteor/packages/meteor-tool folder size. Here is a list of the contents (I am runngin Meteor version 1.3):

  406.6MiB [##########] /.1.3.0_3.1dshdqo++os.linux.x86_64+web.browser+web.cordova
  406.6MiB [######### ] /.1.2.5-rc.8.15auynd++os.linux.x86_64+web.browser+web.cordova
  376.4MiB [######### ] /.1.3.1.du5mv8++os.linux.x86_64+web.browser+web.cordova
  368.1MiB [######### ] /.1.3.2_2.1gi69xa++os.linux.x86_64+web.browser+web.cordova
  368.1MiB [######### ] /.
  326.3MiB [########  ] /.
  202.2MiB [####      ] /.
  202.2MiB [####      ] /.
  202.2MiB [####      ] /.
  202.2MiB [####      ] /.
  201.8MiB [####      ] /.
  201.8MiB [####      ] /.
  190.0MiB [####      ] /.
  190.0MiB [####      ] /.
   98.7MiB [##        ] /.build640720..1.3.0_3.19avti3++os.linux.x86_64+web.browser+web.cordova
@   4.0KiB [          ]  1.2.5-rc.8
@   0.0  B [          ]  1.3.2_2
@   0.0  B [          ]  1.3.0_3
@   0.0  B [          ]  1.0.45
@   0.0  B [          ]  1.0.41
@   0.0  B [          ]  1.0.40
@   0.0  B [          ]  1.3.2
@   0.0  B [          ]  1.1.4
@   0.0  B [          ]  1.1.3
@   0.0  B [          ]  1.1.10
@   0.0  B [          ]  1.1.1
@   0.0  B [          ]  1.0.44
@   0.0  B [          ]  1.3.1
@   0.0  B [          ]  1.1.2

You can just delete all of it and Meteor will re-download everything it needs!

1 Like

What about the .meteor/local/bundler-cache/linker folder - can I delete the contents of this too?

You can delete literally all of ~/.meteor.


ok, I removed the contents of /home/tidee/.meteor and now I’m getting this error when i try and run my app:

'/home/tidee/.meteor' exists, but '/home/tidee/.meteor/meteor' is not executable.
Remove it and try again.

Ah, delete the whole .meteor folder. as in, the folder itself.

For clarity, the ~/.meteor folder and the .meteor folder are in two seperate locations - the latter being the .meteor folder that exists in my project.

1 Like

Ohhh. Yeah I think you can delete all of app/.meteor/local safely. Note that deleting db will reset your local database though.

So generally speaking, best not to touch the app/.meteor folder (apart from the local/bundler-cache folder).

Hi Sashko, I did what you said and removed the ~.meteor folder, then ran my app and am getitng this:

Unable to resolve some modules:

  "./KeyEscapeUtils" in /tidee/app/tidee-meteor/node_modules/react/lib/flattenChildren.js (web.browser)
  "./ReactInstrumentation" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactMount.js (web.browser)
  "./ReactDOMComponentTree" in /tidee/app/tidee-meteor/node_modules/react/lib/findDOMNode.js (web.browser)
  "./ReactFeatureFlags" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactMount.js (web.browser)
  "./DOMLazyTree" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactMount.js (web.browser)
  "./createMicrosoftUnsafeLocalFunction" in /tidee/app/tidee-meteor/node_modules/react/lib/setInnerHTML.js (web.browser)
  "./DOMNamespaces" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactDOMComponent.js (web.browser)
  "./ReactDOMInstrumentation" in /tidee/app/tidee-meteor/node_modules/react/lib/DOMPropertyOperations.js (web.browser)
  "./getVendorPrefixedEventName" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactBrowserEventEmitter.js (web.browser)
  "./DisabledInputUtils" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactDOMTextarea.js (web.browser)
  "./ReactDOMComponentFlags" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactDOMComponent.js (web.browser)
  "./ReactNodeTypes" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactCompositeComponent.js (web.browser)
  "./ReactDOMEmptyComponent" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactDefaultInjection.js (web.browser)
  "./ReactDOMTreeTraversal" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactDefaultInjection.js (web.browser)
  "./SyntheticAnimationEvent" in /tidee/app/tidee-meteor/node_modules/react/lib/SimpleEventPlugin.js (web.browser)
  "./SyntheticTransitionEvent" in /tidee/app/tidee-meteor/node_modules/react/lib/SimpleEventPlugin.js (web.browser)
  "./ReactDOMContainerInfo" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactServerRendering.js (web.browser)
  "./getNativeComponentFromComposite" in /tidee/app/tidee-meteor/node_modules/react/lib/ReactDOM.js (web.browser)

W20160520-15:26:14.722(0)? (STDERR) WARNING: npm peer requirements (for react-meteor-data) not installed:
W20160520-15:26:14.722(0)? (STDERR)  - react-addons-pure-render-mixin@0.14.8 installed, react-addons-pure-render-mixin@15.x needed
W20160520-15:26:14.723(0)? (STDERR)
W20160520-15:26:14.723(0)? (STDERR) Read more about installing npm peer dependencies:
W20160520-15:26:14.723(0)? (STDERR)
W20160520-15:26:14.723(0)? (STDERR)
W20160520-15:26:14.738(0)? (STDERR)
W20160520-15:26:14.739(0)? (STDERR) /home/tidee/.meteor/packages/meteor-tool/.1.3.2_4.10vjklo++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
W20160520-15:26:14.739(0)? (STDERR)                                             throw(ex);
W20160520-15:26:14.739(0)? (STDERR)                                                   ^
W20160520-15:26:14.739(0)? (STDERR) Error: Cannot find module './KeyEscapeUtils'
W20160520-15:26:14.739(0)? (STDERR)     at Function.Module._resolveFilename (module.js:338:15)
W20160520-15:26:14.739(0)? (STDERR)     at Function.Module._load (module.js:280:25)
W20160520-15:26:14.739(0)? (STDERR)     at Module.require (module.js:364:17)
W20160520-15:26:14.739(0)? (STDERR)     at require (module.js:380:17)
W20160520-15:26:14.739(0)? (STDERR)     at Object.<anonymous> (/tidee/app/tidee-meteor/node_modules/react/lib/traverseAllChildren.js:19:22)
W20160520-15:26:14.740(0)? (STDERR)     at Module._compile (module.js:456:26)
W20160520-15:26:14.740(0)? (STDERR)     at Object.Module._extensions..js (module.js:474:10)
W20160520-15:26:14.740(0)? (STDERR)     at Module.load (module.js:356:32)
W20160520-15:26:14.740(0)? (STDERR)     at Function.Module._load (module.js:312:12)
W20160520-15:26:14.741(0)? (STDERR)     at Module.require (module.js:364:17)

is there a way to make meteor-tool… or, well, anything meteor related to Verify package hashes and re-download the partially downloaded ones?

i’ve encountered this problem a couple of times recently… when meteor-tool starts to download packages… but something breaks during the process and then i start getting really weird errors like files missing on import (even if they are part of the project and lay directly next to the file that is importing it)

it just happened with the recent meteor 1.3.3 … i ran a project and meteor said that there is 1.3.3 version available and it is downloading it… but, well, i had to restart the application (i’m in development mode now) to re-read some ENV_VARs. And, well,… it fails to start now :slight_smile: as meteor-tool was just partially unpacked/installed but it got a chance to replace the path to the new tool in ~/.meteor/meteor.bat

as a side note - updating meteor-tool takes painfully long time on windows machine :confused: like an hour or something