ubuntu update java and the nodejs code example
Example: npm inatall latest version ubuntu
// update latest version NPM
sudo npm install -g npm@latest
//update to next version NPM
sudo npm install -g npm@next
// update latest version NPM
sudo npm install -g npm@latest
//update to next version NPM
sudo npm install -g npm@next