sgsheg
sgsheg

Reputation: 154

node js can't install right on my Ubuntu computer

I use the git to install node js, the method I use is below:

mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc

git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local
make install
cd ..

After this, I use node on my command line, it tell me no node.Any one can help me? I got the method form https://gist.github.com/isaacs/579814, but can't work. My path is here. my $PATH

Upvotes: 0

Views: 394

Answers (3)

Wehlematt
Wehlematt

Reputation: 46

I used NVM to install Node.js to my Ubuntu computer:

First install these packages

sudo apt-get install curl build-essential libssl-dev libxml2 libxml2-dev libexpat1-dev

Install nvm

git clone https://github.com/creationix/nvm.git ~/.nvm

To activate nvm, you need to source it from your bash shell (e.g, add to your ~/.bash_profile)

. ~/.nvm/nvm.sh

The following steps are also required when upgrading Node

Install Node (use whichever version you like, but v0.8.x works)

nvm install v0.8.23

nvm alias default v0.8.23

nvm use v0.8.23

Any issues, I would check out the NVM repo.

Upvotes: 1

Anthony Hildoer
Anthony Hildoer

Reputation: 545

This is my build script for node.js on ubuntu. I don't build from the bleeding edge most recent code, but its close to your process.

sudo apt-get update
sudo apt-get -y install build-essential libssl-dev

wget http://nodejs.org/dist/latest/docs/
node_version=`grep -i 'current version' index.html | sed -E 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/'`
wget http://nodejs.org/dist/v$node_version/node-v$node_version.tar.gz
tar -xzf node-v$node_version.tar.gz
cd node-v$node_version
./configure
make
sudo make install
cd ..
rm -rf node-v$node_version.tar.gz node-v$node_version index.html

Upvotes: 0

josh3736
josh3736

Reputation: 144832

You have to make before you make install.

The wiki has more information about building from source.

Upvotes: 3

Related Questions