Friday 27 January 2012

Node.js and Installing Cloud9 IDE

I am a bit infatuated with node.js at the moment and the whole real-time web thing. So trying to get it going on my machine. Why??? A.) I love javascript. B.) I love javascript. Always have. Never in secret. Been glared at for writing jQuery apps, etc. I have done all the other languages too (C#, java... respect.. they've paid my wages).

So... I have been at this for a whole day... phew! Tried on windows (gave up!) and now on Ubuntu. Need to go back to the mac (yes, I admit, the war is now over). I am lazy, I like simple kits, but I like a working IDE, debugger, etc. So I hunted around and found a few...

  • WebStorm (from JetBrains and they still make that super ReSharper VS-addin)
  • Cloud9 IDE - a nodejs based web IDE - how cool.. and open-source so you can run it on your box
WebStorm was simple enough install, could find all the modules but I could not get the debugger going. Anyone good with this, please ping me at kenn9j.at.gmail.com :) 

Cloud9 IDE was not simple to get installed. Too many rig-ma-roles... but it kicked in.. and here is how...
  • Go to http://gratdevel.blogspot.com/2011/03/setting-up-cloud9-on-ubuntu-1010-32-bit.html it says most of it.. (forget windows for now)
  • If you are running a 32-bit Ubuntu on 64-bit windows vmware like me.. all will not go well. So at some point you will get... "error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory" 
  • Fix it with - sudo apt-get install libssl0.9.8 
  • Start cloud9.. point to your project folder and it starts up in the ide.. in your default browser... :) smile... 
path-to-node-v4-build path-to-cloud9.js -w path-to-your-project -a x-www-browser 
~/cloud9/support/node-builds-v4/node-linux32 ~/cloud9/bin/cloud9.js -w ~/devroot/Nodey -a x-www-browser 

  • Add a little app.js file with a server in there like see above. Hit run (will have to configure first time so point to your app.js) 
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(3001, "0.0.0.0");
  • Enjoy! It's a bit slow on my vm but it can debug. (can always two-time with geany) 


No comments: