You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding `node` prompt that does not depend on `nvm` and will work with other version managers as well.
There are now alternative version managers available, such as a much more streamlined [volta.sh](https://volta.sh). It feels like a deja-vu of `rvm` to `rbenv` switch, all over again.
Regardless, we should be able to show the current `node` version whether you are using NVM, VOLTA or a hot potato.
I decided not to add dedicated PREFIX variables for now, but it can be done later.
We still check if `nvm` prompt returns something first because the `declare` check is practically free, and if it returns something — we use it. Only if the output of NVM is blank do we use the new function to grab the version of NodeJS.
There is a caveat — if `node` is installed with the OS, eg `/usr/bin/node` the new function will now pick up the version of that "system" node and show it. Therefore "system" node version will now be visible in the prompt of those who added `node` component to their prompt. Personally, I believe this is the correct behavior, because why should we hide the system node version if that's what's available and in the PATH? We shouldn't. In fact, I think it's rather confusing that previously we wouldn't show the system node version at all.
Tested locally on OS-X/bash:
* with/without NVM
* with/without VOLTA
* with/without system node
0 commit comments