Hello.
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
@denzuko Great. Was making a build box for a CI local agent. This can help in boosting npm install speed yet having different caches for different node versions that build agents fall upon.
For making these transparent to build scripts ( eg: when script clone git repos and run npm install ) making a docker wrapper with node config detection over this would allow them use diff cache.
Most helpful comment
Honestly any user can do
nvm use <version> && npm config set cache .cache/node-<version>to resolve this