Monday, October 25, 2010

Node != Nodejs

Recently built a new Ubuntu 10 VM to test out a few Node.js ideas. While support for windows is improving, it just isn’t ready for prime time. I’m very much a linux noob so I just tried following the various guides out there.

I’ve followed these steps successfully recently so it came as a surprise when running:

   1:  neil@ubuntu:~$ cd node
   2:  neil@ubuntu:~/node$ ./configure

resulted in:

   1:  neil@ubuntu:~/node$ ./configure: 4: autoconf: not found
(or some other such error)

Now trying to brute my way through the install I pushed on and ran:

   1:  neil@ubuntu:~/node$ make
   2:  neil@ubuntu:~/node$ sudo make install
furthers errors ensued…

However then running:

   1:  neil@ubuntu:~/node$ node

gave me the oh so informative:

   1:  The program 'node' is currently not installed.  You can install it by typing:
   2:  sudo apt-get install node

DO NOT RUN sudo apt-get install node

As this will install the node module. Confused? Well node != nodejs. node is apparently a Amateur Packet Radio Node program. Not what we want unless you’re into ham radios… Attempting to run node will usually result in something along the lines of:

   1:  axconfig: port 1 not active 
   2:  axconfig: port 2 not active 

 

How to fix all this? Well thanks to stack-overflow and the nodejs group at least I knew where to start:

First remove the node package:

   1:  sudo apt-get remove --purge node
   2:  sudo apt-get clean

 

And then run the following to get a stable version of nodeJS running (e.g. v0.2.4):

   1:  sudo apt-get install build-essential
   2:  cd node
   3:  git checkout v0.2.4
   4:  ./configure
   5:  make
   6:  sudo make install

 

You should now be able to run nodeJS scripts. YMMV

9 comments:

  1. Thank you. The same things in the same order happened with me. But now I know what to do. Again thanks to you

    ReplyDelete
  2. Thanks, I'm looking on this Node != Nodejs !!

    ReplyDelete
  3. thanks man.You saved my day.I am finally able to run "Helloworld"

    ReplyDelete
  4. LOL! I am happy that I am not the first one to make this mistake, and I am happy that you wrote this so that it only cost me 3 minutes. :) Thanks!

    ReplyDelete
  5. Thanks a lot for your support on this issue !!! appreciated ;0)

    Regards Julian

    ReplyDelete
  6. Thanks for this information! Even after following the instructions on this page and removing the 'node' package, and re-installing the 'nodejs' package, it would /still/ not being using the 'node' command, so in the end I added a different apt repository, as explained in the docs here: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager Then I ran a 'apt-get update' and updated nodejs and it finally started using the 'node' command!

    ReplyDelete
  7. I have read several excellent stuff here. Certainly price bookmarking for revisiting.
    I surprise how much effort you place to make
    this sort of excellent informative web site.



    my site; car title loans los angeles

    ReplyDelete