1. Check the current version
node -v
2. nstall n package using npm if you do not have it installed yet.
sudo npm install -g n
3. Then, you can update your Node.js to the version you want.
sudo n stable
Welcome to my blog
node -v
sudo npm install -g n
sudo n stable