I'm using fish-shell and I'm unable to use nvm as it stands.
However, with a wrapper file cat nvm:
if [[ -s $HOME/.nvm/nvm.sh ]] ;
echo "No nvm found in `$HOME/.nvm/nvm.sh`";
I can easily use it. However, it does not set the PATH.
Setting the default node could easily be accomplished if a .nvm/default pointed to the default version. For example, .nvm/default -> v0.10.28/
.nvm/default -> v0.10.28/
I suggest that nvm alias default 0.10.28 create such a link as then I could easily alter my path to include .nvm/default/bin
nvm alias default 0.10.28
Were there any thoughts on this? I'd like to be able to use other shells easily with this.
fish is the only shell that it doesn't work with, and it's so vastly different from other POSIX-compliant shells that there's not going to be a fast solution. You can look into https://github.com/Alex7Kom/nvm-fish for the time being as well.
Yes, but wouldn't my solution work for all shells? since it uses a bash wrapper? And isn't that a better solution as it's generic?
Your approach would re-source nvm.sh on every call to nvm - that doesn't seem like the approach we want here.
I'd be OK with nvm alias default (and only default) creating a symlink in ~/.nvm - as well as nvm use creating a symlink under ~/.nvm/current. Please feel free to submit (separate) PRs for those if you're interested!
nvm alias default
OK, will do. One of the issues I had was actually that nvm tended to pollute my path in bash. I'll have a look at implementing it
See PR here: #447
I wasn't sure what to do for a test though.