tl;dr I added local to all variables that are used internally to NVM. Variables that are used externally should be prefixed with NVM_.
Some days ago I had a really hard day trying to figure out, why my rake db:migrate task was not working. The issue was, that nvm silently added a VERSION environment variable which is used by rake/rails to force the database migration towards a specific version.
Long story short: nvm was leaking a lot of variables.
You can easily test this by doing something like:
env > env_before
env > env_after
npm install v0.8.14
env > env_after_install
If you look at a diff of the env_-files you can see what I mean.
avoid environment pollution with NVM internals
Thank you very much. I've been meaning to do this but didn't know how.