# update nvm remote
nvm ls-remote
# install latest npm or npm lts
nvm install-latest-npm
nvm intall --lts
# select required version of npm, I always use the long term supported version
nvm use --lts
nvm install latest
nvm install stable --reinstall-packages-from=current
# With NVM
yay -S nvm
echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
exec $SHELL
nvm ls-remote
nvm install v18.1.0
nvm install "lts/*" --reinstall-packages-from="$(nvm current)"
updates nvm nodejs version;
cd ~/.nvm/versions/node/v4.2.2/lib
npm install npm
#!/bin/sh
set -e
cd ~/.nvm
git fetch --tags
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Checking out tag $TAG..."
git checkout "$TAG"
source ~/.nvm/nvm.sh