Vagrant Maintenance Quickies

I spin up a lot of Vagrant boxes in /tmp for quick tests. Those tend to disappear before they’re properly cleaned up. Run this every once in a while to clear out Vagrant’s cache:

$ vagrant global-status --prune

Another, more tedious task is clearing out old boxes. This can recover quite a bit of disk space.

$ vagrant box list
$ vagrant box remove ubuntu/trusty32 --box-version 20150908.0.0

The box-version flag is necessary when a box has more than one version isntalled. The version string is the last value in parentheses listed by vagrant box list.

Contributing to node modules

Writing this down since it always takes me a while to piece together after I’ve forgotten it. Basically local development of npm modules is all npm link

  1. Clone the module somewhere locally
  2. cd into the module directory
  3. run npm link
  4. cd into some project using the module
  5. run npm link module-name

To clean this up afterwards, run npm unlink.

If you’re working on a dependency of a dependency, directly install the public version of that module before linking (I think?). Newer versions of NPM use a flat dependency graph and it should all just work. (couldn’t find a reference on this, sorry)