# 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)"
cd ~/.nvm/versions/node/v4.2.2/lib
npm install npm