Install nodejs on my Ubuntu 9.10

Sekarang saya sedang mencoba untuk melakukan instalasi nodejs via package manager dengan melakukan langkah-langkah berikut:

  1. sudo apt-get install python-software-properties
  2. sudo add-apt-repository ppa:jerome-etienne/neoip
  3. sudo apt-get update
  4. sudo apt-get install nodejs

Setelah menjalankan perintah pada langkah ke-1, saya mendapatkan hasil berikut:

Reading package lists... Done
Building dependency tree
Reading state information... Done
python-software-properties is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Setelah menjalankan perintah pada langkah ke-2, saya mendapatkan hasil berikut:

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 9E7A874FE356F3DA21C1D311DC36A41C2D83C357
gpg: requesting key 2D83C357 from hkp server keyserver.ubuntu.com
gpg: key 2D83C357: "Launchpad neoip" not changed
gpg: Total number processed: 1
gpg: unchanged: 1

Setelah menjalankan perintah pada langkah ke-3, saya mendapatkan hasil berikut:

Hit http://ppa.launchpad.net karmic Release.gpg
Ign http://ppa.launchpad.net karmic/main Translation-en_US
Hit http://security.ubuntu.com karmic-security Release.gpg
Hit http://archive.canonical.com karmic Release.gpg
Ign http://security.ubuntu.com karmic-security/main Translation-en_US
Ign http://security.ubuntu.com karmic-security/restricted Translation-en_US
Ign http://archive.canonical.com karmic/partner Translation-en_US
Hit http://id.archive.ubuntu.com karmic Release.gpg
Ign http://id.archive.ubuntu.com karmic/main Translation-en_US
Ign http://id.archive.ubuntu.com karmic/restricted Translation-en_US
Hit http://linux.dropbox.com karmic Release.gpg
Ign http://linux.dropbox.com karmic/main Translation-en_US
Get:1 http://dl.google.com stable Release.gpg [198B]
Hit http://ppa.launchpad.net karmic Release
Ign http://security.ubuntu.com karmic-security/universe Translation-en_US
Ign http://security.ubuntu.com karmic-security/multiverse Translation-en_US
Hit http://security.ubuntu.com karmic-security Release
Hit http://archive.canonical.com karmic Release
Ign http://id.archive.ubuntu.com karmic/universe Translation-en_US
Ign http://id.archive.ubuntu.com karmic/multiverse Translation-en_US
Hit http://id.archive.ubuntu.com karmic-updates Release.gpg
Ign http://id.archive.ubuntu.com karmic-updates/main Translation-en_US
Ign http://id.archive.ubuntu.com karmic-updates/restricted Translation-en_US
Ign http://id.archive.ubuntu.com karmic-updates/universe Translation-en_US
Ign http://id.archive.ubuntu.com karmic-updates/multiverse Translation-en_US
Hit http://linux.dropbox.com karmic Release
Hit http://id.archive.ubuntu.com karmic Release
Hit http://ppa.launchpad.net karmic/main Packages
Ign http://dl.google.com stable/main Translation-en_US
Hit http://linux.dropbox.com karmic/main Packages
Hit http://security.ubuntu.com karmic-security/main Packages
Hit http://archive.canonical.com karmic/partner Packages
Hit http://id.archive.ubuntu.com karmic-updates Release
Get:2 http://dl.google.com stable Release [1,351B]
Hit http://id.archive.ubuntu.com karmic/main Packages
Hit http://id.archive.ubuntu.com karmic/restricted Packages
Hit http://id.archive.ubuntu.com karmic/main Sources
Hit http://id.archive.ubuntu.com karmic/restricted Sources
Hit http://id.archive.ubuntu.com karmic/universe Packages
Hit http://id.archive.ubuntu.com karmic/universe Sources
Hit http://id.archive.ubuntu.com karmic/multiverse Packages
Get:3 http://dl.google.com stable/main Packages [1,229B]
Hit http://security.ubuntu.com karmic-security/restricted Packages
Hit http://security.ubuntu.com karmic-security/main Sources
Hit http://security.ubuntu.com karmic-security/restricted Sources
Hit http://id.archive.ubuntu.com karmic/multiverse Sources
Hit http://id.archive.ubuntu.com karmic-updates/main Packages
Hit http://id.archive.ubuntu.com karmic-updates/restricted Packages
Hit http://id.archive.ubuntu.com karmic-updates/main Sources
Hit http://id.archive.ubuntu.com karmic-updates/restricted Sources
Hit http://id.archive.ubuntu.com karmic-updates/universe Packages
Hit http://id.archive.ubuntu.com karmic-updates/universe Sources
Hit http://id.archive.ubuntu.com karmic-updates/multiverse Packages
Hit http://security.ubuntu.com karmic-security/universe Packages
Hit http://security.ubuntu.com karmic-security/universe Sources
Hit http://security.ubuntu.com karmic-security/multiverse Packages
Hit http://security.ubuntu.com karmic-security/multiverse Sources
Hit http://id.archive.ubuntu.com karmic-updates/multiverse Sources
Fetched 2,778B in 3s (879B/s)
Reading package lists... Done

Setelah menjalankan perintah pada langkah ke-4, saya mendapatkan hasil berikut:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package nodejs

Tampaknya instalasi nodejs via package manager tidak berhasil saya lakukan dan saya harus mencoba metode instalasi yang lain, yaitu dengan melakukan building from sources.

Untuk building from sources lakukan dengan cara berikut:

git clone --depth 1 https://github.com/joyent/node.git
cd node
export JOBS=2 # optional, sets number of parallel commands.
mkdir ~/local
./configure --prefix=$HOME/local/node
make
sudo make install
export PATH=$HOME/local/node/bin:$PATH

Saat memasuki langkah ke-4 dari building and installing Node.js untuk melakukan instalasi npm, dengan menjalankan perintah berikut:

  1. curl http://npmjs.org/install.sh | sh [Tidak berhasil]
  2. curl http://npmjs.org/install.sh | clean=no sh [Tidak berhasil]
  3. curl http://npmjs.org/install.sh | clean=yes sh [Tidak berhasil]
  4. sudo node ./cli.js install -g [berhasil!]

Jadi, setelah mencoba dari cara ke 1-3 tidak berhasil kemudian saya mencoba cara ke-4. Untuk menjalankan cara ke-4 tersebut saya harus berpindah ke direktori dimana npm terletak. Sebelumnya saya tidak berhasil menjalankan cara ke-4 tersebut, tapi kemudian saya mencoba mengetikkan fullpath dari node:

ghazali@laptop:~/npm$ sudo ~/local/node/bin/node ./cli.js install -g
/home/ghazali/local/node/bin/npm -> /home/ghazali/local/node/lib/node_modules/npm/bin/npm.js
npm@1.0.9-1 /home/ghazali/local/node/lib/node_modules/npm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s