nvm icon indicating copy to clipboard operation
nvm copied to clipboard

Add info on how to enable version auto switching using .bashrc file

Open mik356ua opened this issue 8 years ago • 8 comments

Add info on how to enable version auto switching using .bashrc file when entering directory that contains .node-version file and fallback to default version on entering directory that doesn't contain .node-version file

mik356ua avatar Apr 19 '16 13:04 mik356ua

No problem, .nvmrc will work as well. Changed file names in ac7e0a8

mik356ua avatar Apr 21 '16 18:04 mik356ua

That's a good point. Didn't know about --silent option. Added it in 9773734

mik356ua avatar Apr 22 '16 12:04 mik356ua

Hm..strange thing but it doesn't work for me. I run nvm use --silent in terminal but it says: No .nvmrc file found followed by whole help output when directory does not conatin .nvmrc. I tried tag 0.31.0 and master branch with latest commit 96afff7 on Ubuntu 14.04. Are sure it should work this way?

mik356ua avatar Apr 24 '16 13:04 mik356ua

@mik356ua oops, you're right. the behavior i'm thinking of is when nvm.sh is sourced. nvm_auto use is the internal (but not documented) mechanism used here. It's probably fine to rely on that - I could also expose it as an nvm command.

ljharb avatar Apr 24 '16 16:04 ljharb

Is there a reason why nvm can't also support .node-version if present as a fallback to .nvmrc? That may make it easier to collaborate with Windows folks using nodist.

ldeck avatar Apr 26 '16 04:04 ldeck

@ldeck nvm supports nvm-specific syntax in nvmrc. node-version is not a standard, and if it were to be, all of the node version management tools (as well as ideally node itself) would have to agree on what syntax it supports. It would be exceedingly bad for something to become commonly used before all of the issues had been properly worked out with all of the interested parties, and I won't allow nvm to bless .node-version until that happens.

ljharb avatar Apr 26 '16 04:04 ljharb

@ljharb cool. Thanks.

ldeck avatar Apr 26 '16 05:04 ldeck

Please merge this one in. I searched a while before i got this. Great work, thx man

dazlious avatar May 07 '18 09:05 dazlious