Installing nodeJS

3

3

I install nodeJS like here shown: http://nodeguide.com/beginner.html

I have done these steps: wget http://nodejs.org/dist/node-v0.4.4.tar.gz and tar -xzf node-v0.4.4.tar.gz

But when I try this: cd node-v0.4.4.tar.gz it gives me an error: sh: line 0: cd: node-v0.4.4.tar.gz: Not a directory

And when I try this: ./configure it gives me sh: ./configure: No such file or directory

And finally when I try sudo make install it says sudo: sorry, you must have a tty to run sudo

Thank you very much

hey

Posted 2011-04-19T21:01:15.273

Reputation: 1 616

Answers

3

You may need to unzip the file before untarring it.

gzip -d node-v0.4.4.tar.gz
tar -xvf node-v0.4.4.tar
cd node-v0.4.4
./configure

Matthieu Cormier

Posted 2011-04-19T21:01:15.273

Reputation: 146

@Matthieu Cormier: it helped me, but when I try ./configure it gives me sh: ./configure: No such file or directory – hey – 2011-04-19T21:09:46.620

try changing the permissions of the file with chmod 755 configure – None – 2011-04-19T21:36:20.680

@Matthieu Cormier: through ftp or where? – hey – 2011-04-19T21:39:53.613

if you do ls do you see the configure file? – None – 2011-04-19T21:46:55.227

@Matthieu Cormier: no, I don't see it in ftp. – hey – 2011-04-19T21:48:38.473

Are you doing this remotely, on an ftp client? – tladuke – 2011-04-20T01:10:09.250

@tladuke: through command line – hey – 2011-04-20T10:28:20.097

2

There is more simpler way:

$ sudo pip install nodeenv

# install latest node.js in sandbox
$ nodeenv test-node-env

# activate sandbox environment
$ source ./test-node-env/bin/activate

# work in sandbox
(test-node-env) $ node -v
v0.4.6

nodeenv - virtual environment for node.js

shorrty

Posted 2011-04-19T21:01:15.273

Reputation:

@shorrty: sudo: sorry, you must have a tty to run sudo – hey – 2011-04-20T10:29:29.970

1

cd node-v0.4.4.tar.gz

node-v0.4.4.tar.gz is a file, not a directory that you can go into. Running

tar -xzf node-v0.4.4.tar.gz

should uncompress the tar.gz into a directory with a similar name.

tladuke

Posted 2011-04-19T21:01:15.273

Reputation: 278

@tladuke: I have done that, still the same error. – hey – 2011-04-19T21:07:02.220

works for me. maybe it didn't download completely. – tladuke – 2011-04-19T21:13:14.750

1

I highly recommend using nvm: https://github.com/creationix/nvm

nvm lets you install multiple versions of node and switch between them. It is as simple as this:

git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
nvm install v0.4.7
nvm use v0.4.7

don't forget to add ~/.nvm/nvm.sh to your path so that you can use it in later sessions.

Russ Bradberry

Posted 2011-04-19T21:01:15.273

Reputation: 829

0

On Ubuntu, I prefer to install Node using NPM and n, which is a node version manager that you can get through NPM! It's very easy to get node like this (and you will probably want NPM anyway.) From the command line:

sudo apt-get install -y npm
sudo npm install -g n
sudo n lts

fullstackdev

Posted 2011-04-19T21:01:15.273

Reputation: 1

0

Had the exact same problem, and it was as simple as the download didn't complete, so it hadn't downloaded configure. Try starting from scratch and it should download configure along with the rest, and then when you do ./configure it should work.

If, after you cd into the directory starting with "node" (NOT the .tar.gz file, but rather the directory with almost the same name that was created by the "tar -xzf" command) and "ls", it doesn't show any file or directory called "configure", then it didn't all download, so go get the .tar.gz file again.

rossdavidh

Posted 2011-04-19T21:01:15.273

Reputation: 101

0

You probably downloaded the binary (compiled) version of nodejs when you download it from the nodejs.org download page. It might be a bit confusing, since the downloaded archive's README.md file states that you should run ./configure as one of the steps needed to install nodejs on your system.

If you want to build nodejs yourself, you should rather download the archive from the github project page. The downloaded archive will contain the configure script and you will be able to install nodejs by following the steps mentioned in the included README.md file.

Werner

Posted 2011-04-19T21:01:15.273

Reputation: 111