Installing NVM (Node Version Manager) by downloading and running a script
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
Warning: Close and reopen your terminal to start using nvm
Verify that nvm was properly installed
nvm --version
Installing Node.js and npm
nvm install node
nvm install --lts
Installing specific version
nvm install 12.22.7
Check node.js list by nvm
nvm ls
Switch to node.js version
nvm use 12.22.7