Note: If you get "301 Moved Permanently" then try curl -0 -L http://npmjs.org/install.sh | sudo sh to follow redirects. Also notice I added sudo before the sudo sh command depending on your users permissions.
If you want to update stable version of nodejs. n is another nodejs version manager. or you can just go to nodejs.org, download and install it.