Monday, March 21, 2011

Easier Way of Setting up Cloud9 on Ubuntu 10.10 32-bit desktop w/ nvm

EDIT: Thanks to William Rayner, it seems the current npm module can be used with the latest stable node. It’s those pesky o3 tools causing problems again. Anyway, check out v3 below for a non-version dependant install script for cloud9.

Ok, lets try this again. Last time around I spent a lot of time fumbling in the dark, hitting various errors and generally using a sledgehammer approach to getting the Cloud9-ide app running. Hopefully this time around it’ll be more like a Pozidriv.

Now I think the following script should install the latest versions of node, npm and cloud9. Hopefully, if someone stumbles upon this post in the future they’ll be able to follow this regardless of what the current versions and dependencies are.

v1) *Unstable* – node stable, npm stable, cloud9 0.2.0 w/ o3 binaries

sudo apt-get install -y git-core libssl-dev curl
 
git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
nvm sync
nvm install stable
nvm use stable
 
npm install cloud9
 
cloud9

Note: I stumbled upon the fact that once you install cloud9, that you can launch it just by calling cloud9 (instead of “user@machine> node /path/to/cloud9.js”). Not sure if this is a standard npm thing or specific to cloud9, nice to know regardless.

This all seems a little too good to be true. Unfortunately, for now, it is. It seems the current combination of the latest node and the cloud9 module are incongruous, so you’ll just have to follow my previous guide for now ;)

 

… or a combination of the two. Use this if you want the most up-to-date cloud9

v2) *Stable*, node stable, npm stable, cloud9 devel branch, compiled o3 tools

sudo apt-get update
sudo apt-get install -y build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
 
git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
nvm sync
nvm install stable
nvm use stable 
 
git clone git://github.com/ajaxorg/cloud9.git
cd cloud9
git checkout devel
git submodule update --init --recursive
bin/cloud9.sh
cd ..
 
git clone http://github.com/ajaxorg/o3
cd o3
./tools/node_modules_build
cp build/default/o3.node ../cloud9/support/jsdav/support/node-o3-xml-v4/lib/o3-xml/
cd .. 
 
node ~/cloud9/bin/cloud9.js -w ~/yourproject

 

v3) *Stable*, node stable, npm stable, cloud9 0.2.0, compiled o3 tools

sudo apt-get install -y git-core libssl-dev curl libxml2-dev
 
git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
nvm sync
nvm install stable
nvm use stable
 
npm install cloud9
 
git clone https://github.com/ajaxorg/o3.git
cd o3 
./tools/node_modules_build
sudo cp build/default/o3.node ~/.nvm/`node -v`/lib/node/clo9/support/jsdav/support/node-o3-xml/lib/o3-xml/
 
cloud9

Again, good luck!

3 comments:

  1. Thank you. The v3 solution worked great for me!

    ReplyDelete
  2. Thanks for the info, I tried v3, I had to sudo the node_modules_build, and then I can't get the last line to work (sudo cp buid...). I'm new to Linux, is the "`" supposed to be in the command line? Anyway I get a "no such file or directory (.../.nvm/v0.4.5/lib/node/clo9/ doesn't exist, in fact). And if I try to run cloud9 anyway (using node /path/to/cloud9.js), I get:

    node.js:134
    throw e; // process.nextTick error, or 'error' event on first tick

    Any ideas? Maybe not the best place to post this, should try the forums, but since it's related to the installation process above, thought I'd give it a shot!

    ReplyDelete
  3. Hi Anonymous, yep probably best to try on the forums ;)

    ReplyDelete