Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update node.js version inside Cloud 9 IDE

My Cloud 9 workspace is running with Node.Js 0.10. How can I update it to the latest version of Node.Js (today is 0.12.4)?

I'm trying to install Node.Js using apt-get but I will always get 0.10 version.

UPDATE: Latest version of Cloud 9 workspaces now have preinstalled version 4.1.1

like image 828
Davide Icardi Avatar asked Jun 03 '15 22:06

Davide Icardi


People also ask

How can I update my NodeJS to the latest version?

To use this method for updates, follow the steps below: Run npm -v to see which installed version you're currently using. Run npm install npm@latest -g to install the most recent npm update. Run npm -v again to validate that the npm version was updated correctly.

How do I update NodeJS to a specific version of Windows?

Just visit the Node installers page at https://nodejs.org/en/download/ and download and install the latest node version. From the “previous releases” section at the bottom of the page, you can select a specific version to install.

Can you use NPM to update Node?

Option 2: Update Node. NPM is a tool for installing and managing package dependencies. If you have Node on your system, you have NPM, as well. With the npm command, you can check running Node. js versions and install the latest release.


2 Answers

With Cloud 9 you can use NVM to install a new version of Node.js. Just run:

nvm install 5.5.0 nvm use 5.5.0 nvm alias default v5.5.0 

NVM keeps all the versions so you can switch back whenever you want.

See also https://docs.c9.io/v1.0/docs/writing-a-nodejs-app.

like image 133
Davide Icardi Avatar answered Sep 25 '22 08:09

Davide Icardi


To improve on Davide Icardi's answer, this installs the latest stable version:

nvm install stable 

Worked for me in Cloud9.

like image 44
Joe Maffei Avatar answered Sep 25 '22 08:09

Joe Maffei