You can use the nvm package to get the desired version. It allows flexibility to change the version whenever you want.
For installation of nvm refer github
Once done, you can fire “nvm install node” This installs the latest version of node js.
“nvm install 14.7.0” This installs version 14.7.0 of node js (Similarly you can install any version 16.3.0, 12.22.1, etc)
Note: The first version you install using nvm will become the default version.
Visit the official Node.js website and download the latest LTS (Long Term Support) version or the required version for your operating system.
Run the installer and keep in mind to check the option of updating the current version while installing.
Reopen the terminal and fire “node –version” command to check the version