Open a new terminal window on your machine (
T keyboard shortcut).
Then run the script to install Nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
When that's done, verify that it was installed correctly:
That should output a version number.
Then, you can install the latest version of Node.js:
nvm install node
When the installation process is complete, test to make sure Node.js was installed correctly:
You can read more on their GitHub page: https://github.com/nvm-sh/nvm.
Nvm provides a good guide in their documentation: https://github.com/nvm-sh/nvm#installing-and-updating.