If you already have ndenv on your computer you need to remove it (it's not supported anymore).
Remove commands related to ndenv from ~/.bash_profile file:
# remove those lines
export PATH="$HOME/.ndenv/bin:$PATH"
eval "$(ndenv init -)"Remove ndenv:
$ rm -rf ~/.ndenvInstall nodenv and add initializer in .bash_profile:
brew install nodenv
eval "$(nodenv init -)" # add it to .bash_profileBy default nodenv uses node-build package to get information about available nodejs versions. This package can have outdated information. To get latest available node version you need to install node-build-update-defs plugin and run update-version-defs command:
git clone https://github.com/nodenv/node-build-update-defs.git "$(nodenv root)"/plugins/node-build-update-defs
nodenv update-version-defsnodenv uses .node-version file to understand which version of nodejs should be used. By default you need to specify full version number here (e.g. 10.13.0). It's not very convenient (e.g if you decide to update dependency to next minor version (e.g. 10.13.1) you will need to update this version in .node-version file and your teammate will have to do the same thing). To prevent such problem you can use nodenv-aliases plugin. With this plugin you can specify major version in .node-version file and this symlink will point to different minor versions for different teammates. Clone this plugin:
git clone https://github.com/nodenv/nodenv-aliases.git $(nodenv root)/plugins/nodenv-aliasesInstall latest node.js version (e.g. 20.5.1) and create alias for it:
nodenv install 20.5.1
nodenv global 20.5.1
nodenv alias 20 --auto