Installing Node.js and NPM on Ubuntu 10.10

Post to Twitter

In a previous article I laid out the steps to install NodeJS and NPM on Ubuntu 10.04. Today I’m going to slightly update and hopefully simplify those steps and bring the version of Ubuntu up to 10.10. This will be a quick and to the point article showing only what you need to get working with NodeJS and NPM.


From the Ubuntu command line issue the following commands (if you want to use apt-get, or see the next section for using aptitude):

Using apt-get:

$ sudo apt-get update
$ sudo apt-get install git-core curl build-essential openssl libssl-dev
$ git clone https://github.com/joyent/node.git && cd node
$ ./configure
$ make
$ sudo make install
$ node -v
$ cd
$ curl http://npmjs.org/install.sh | sudo sh

Using aptitude (and assuming it is not currently installed):

$ sudo apt-get update
$ sudo apt-get install aptitude
$ sudo aptitude install git-core curl build-essential openssl libssl-dev
$ git clone https://github.com/joyent/node.git && cd node
$ ./configure
$ make
$ sudo make install
$ node -v
$ cd
$ curl http://npmjs.org/install.sh | sudo sh

NodeJS and NPM should now be installed. You can test NodeJS out like so:

$ node -v

Type the following into your editor of choice:

var sys = require('sys');
sys.puts('Hello World');

Save the file as helloworld.js.

Run the code like so:

$ node helloworld.js

Easy as that!

Post to Twitter

This entry was posted in Node.js, Open Source, Ubuntu. Bookmark the permalink.

23 Responses to Installing Node.js and NPM on Ubuntu 10.10

  1. Rune Kaagaard says:

    Works perfectly, thanks! One thing has changed though, the node github project is at https://github.com/joyent/node.git now.

  2. Chad Lung says:

    @Rune,

    Thanks, updated.

    Chad

  3. mvtm says:

    .deb package for 10.04, but I think they will work in 10.10 to:
    http://mvtm.livejournal.com/489313.html

  4. Pingback: Build a simple chat web app with JQuery Mobile and NowJS (a module for NodeJS) | Giant Flying Saucer

  5. Pingback: Run a chat server with NowJS (using NodeJS) on Ubuntu 10.10 | Giant Flying Saucer

  6. carlson says:

    what about the client part?
    same process and installation?
    i’m just only a beginner..thx

  7. Chad Lung says:

    @Carlson,

    What client part are you talking about? The above article was done on Ubuntu 10.10 (Desktop).

    Chad

  8. carlson says:

    i want to make a chat server between two PCs (network them)
    i already install nowjs in the pc1 and it works..what about for pc2?the same installation?thx

  9. Chad Lung says:

    @carlson,

    The same client should work on all machines. See my article here:
    http://www.giantflyingsaucer.com/blog/?p=2523

    Chad

  10. carlson says:

    thx dude..if i run the nowjs at the terminal of pc1, should i also run it in pc2?even though they are now connected to each other(lan network)..

  11. carlson says:

    i am thinking that pc2 will connect through http://localhost:8080?is it right?

  12. Chad Lung says:

    @carlson,

    localhost won’t work for the second pc, you need to use the ip address of the pc where the nowjs server is running.

    Chad

  13. carlson says:

    i try it, the second pc connect to the server via ip of server but in the terminal it does not detect the second pc..help, thx

  14. Pingback: Getting started with CouchDB and NodeJS on Ubuntu 10.10 | Giant Flying Saucer

  15. Anonymous says:

    The aptitude example still points to https://github.com/ry/node.git instead of joyent

  16. Chad Lung says:

    @Anonymous,

    Thanks, fixed.

    Chad

  17. Pingback: Using NodeJS with MySQL | Giant Flying Saucer

  18. laabroo says:

    thanks to your tutorial brader :D

  19. Pingback: Installing Node.js and NPM on Ubuntu 11.04 | Giant Flying Saucer

  20. Pingback: Cómo instalar Node.js | Chalchicha.es

  21. sattanaathan says:

    Just a noob question …

    I have seeen a lotta tuts on node.js but nothing explains the folder architecture/where exactly the helloworld.js should be saved …

    it will be cool if you can share your thoughts

  22. Anonymous says:

    hey chad the website for the line:
    git clone https://github.com/joyent/node.git && cd nod

    is not working when i check the website its not functional anymore can you give me another one that is working i really wanna do this project.

    more power

  23. D0MG3R says:

    The “sys” module is now called “util”. It should have a similar interface:

    var sys = require(‘util’);
    sys.puts(‘Hello World’);

Comments are closed.