Shouldn't we have a separate npm cache folder for each node version?
So that packages caches won't step on each other.
nvm is nothing more than a bash script that auto-configures node with a custom prefix and messes with your path. Where does npm store it's cache? If it's relative to the node install then it's separate.
It is located in ~/.npm so shared accross nodejs versions that nvm installed.
I see. Though I'm not sure there is much value in not sharing the cache. It's all coming from the same npm repository. I guess if the cache format changed in some backwards incompatible way, then it could be dangerous. Still this seems outside the scope of nvm. I don't mess with how node or npm work. Just provide an easy way to install several versions and switch between them. Maybe there is some NPM_* environment variable we could set to move the cache to inside the local install?
Do any packages vary by node version? If not, let's close this.
only the builded packages can vary I guess. No big deal here I think.
Honestly any user can do nvm use <version> && npm config set cache .cache/node-<version> to resolve this
nvm use <version> && npm config set cache .cache/node-<version>