lukechilds / zsh-nvm

Zsh plugin for installing, updating and loading nvm
MIT License
2.24k stars 113 forks source link

zsh-nvm use not fully working #53

Closed abz123 closed 5 years ago

abz123 commented 5 years ago

Able to change node versions in an open terminal. Then opening a new tab or closing/opening terminal or switching panes in tmux reverts to initial node version?

↳ nvm ls
-> v10.15.2 v10.15.3

↳ nvm use 10.15.3 Now using node v10.15.3 (npm v6.4.1)

↳ nvm ls
v10.15.2 -> v10.15.3

Opened a new tab in terminal Or closed and opened terminal Or in tmux switched panes in same window and session: ↳ nvm ls -> v10.15.2 v10.15.3

Ubuntu 18.04, zsh, omz, tmux

lukechilds commented 5 years ago

That's expected nvm behaviour:

  nvm use [--silent] <version>              Modify PATH to use <version>. Uses .nvmrc if available

It just modifies the PATH of the current session.

If you want to set a default Node.js version you need to alias it:

  nvm alias default 8.1.0               Set default node version on a shell
abz123 commented 5 years ago

Did not read about alias which works as you showed, thankyou.