How do I install the the latest version of nodejs?

nodejs

#1

When I install nodejs using npm install node.js --save, I’m only getting version 4.6.1. I’m trying to use nodemailer but I’m told I need v6.0.0 or higher - how do I upgrade?


#2

use nvm

nvm install 6
nvm alias default 6

#3

Brilliant! Thank you!


#4

nvm ls

bash: nvm: command not found

I’m using Cloud 9 for Node JS on a Beaglebone Black (preinstalled) and NVM does not seem to be present. All of the Cloud 9 docs say that NVM should already be there.