lukechilds / zsh-nvm

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

Installing nightly changed the stable alias?? #39

Open cswl opened 7 years ago

cswl commented 7 years ago
nvm  list
         v8.6.0
         v9.2.0
-> v10.0.0-nightly20171121a95d88c881
default -> node (-> v10.0.0-nightly20171121a95d88c881)
nightly -> v10.0.0-nightly20171121a95d88c881
node -> stable (-> v10.0.0-nightly20171121a95d88c881) (default)
stable -> 10.0 (-> v10.0.0-nightly20171121a95d88c881) (default)

Is this expected behavior, doesn't seem like it.

lukechilds commented 7 years ago

Thanks for reporting, it's not the intended behaviour but installing nightly|rc builds is kind of a hack and as such leaving those versions installed my result in strange behaviour.

From the readme:

Note: This is a bit of a hack and leaving rc|nightly versions installed may break nvm when it eventually supports them itself. It's recommended that you don't leave the these versions of Node.js installed. Install them, test/play with them and then uninstall them when you're done.

If you want to submit a PR that fixes this behaviour I'd happily accept it!

cswl commented 7 years ago

As I see the problem is we install the nightly as nvm install node . I can think of workaround to is to first parse index.json and instead calling nvm install v10.0.0-nighlty*

Since we now install it as an absolute version instead of node nvm will not update the stable and node alias. With this approach, nightly just acts like user-defined alias.. and the version just like any regular version.

I will start working on it..