Updating node to the latest version

nodejs

#1

I want to update node to version > 8.1
After trying to update npm to the latest version I now get
Error: Cannot find module ‘process-nextick-args’.
I am lost.


#2

it was a solution for me in a similar case. hope i help you.

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/8.4.0/bin/node /usr/bin/nodejs

original issue


#3

I did not think you needed sudo on cloud9. I am getting the same error for every command I try.


#4

you got one error for every command?
are you trying remove with purge and reinstall node and npm?


#5

The simplest way to upgrade your node version is to use nvm: Node Version Manager, which comes pre-installed in the cloud9 containers.

Simply run nvm i v<your version>, for example nvm i v8 installs the latest node 8, for now v8.5


#6

Screenshot from 2017-09-20 22-57-47
How do I remove Node 4.x.x?