7

ok so I got a dedicated linux server and I'm trying to install node.js

i ran

wget http://nodejs.org/dist/node-v0.4.11.tar.gz tar zxf node-v0.4.11.tar.gz cd node-v0.4.11 

all is well

then i ran

 ./configure 

and i got

Checking for program g++ or c++ : not found Checking for program icpc : not found Checking for program c++ : not found wscript:232: error: could not configure a cxx compiler! 

so i google that error if found a page that says run this

 sudo apt-get install build-essential libssl-dev curl git-core 

but then i get

-bash: sudo: command not found 

please help me I don't know what to do now

4
  • 1
    Don't install 4.11, install 6.7 or whatever is the latest version Commented Jan 15, 2012 at 0:53
  • there is a reason why i want 4.11 Commented Jan 15, 2012 at 0:55
  • 2
    Is it a stupid one? I'm pretty sure it is. Commented Jan 15, 2012 at 1:10
  • haha yeah probablly some other thing I want to install doesn't work with newer versions os node.js Commented Jan 15, 2012 at 1:13

2 Answers 2

8

If you are running some debian based distro, that code should work. Since you are running CentOS, you can follow this link. Different linux distros use different package managers. It looks like that debian is the most popular (ubuntu, mint, debian...) so many online tutorials you find use apt to get everything installed. Your choice is different and you should use rpm/yum. Since you are missing gcc compiler, you should try executing this command (you should probably add some more packages, not sure):

yum install sudo gcc-c++ 

EDIT: Updated link to serverfault.com

Sign up to request clarification or add additional context in comments.

5 Comments

-bash-3.2$ su -bash: su: command not found -bash-3.2$ apt-get install sudo -bash: apt-get: command not found
can you try typing: "whereis sudo". It might happen that it is not in your path.
when I do that it return "sudo:"
what version of linux are you running (I mean, what distribution)?
That explains why you don't have apt-get...apt is not package manager for CentOS, but debian based distros (like ubuntu)...for installing nodejs on cent os, you can take a look at this link: chrisabernethy.com/installing-node-js-on-centos-redhat I've updated my answer to make more sense for your situation.
1

Actually the error output tells you exactly what's missing: sudo. Quick Googl'ing should reveal what this tools meaning is: It lets you execute commands with root privileges, provided you have access to a user account that's privileged enough to use this functionality.

So you need root privileges to install packages. This is not surprising. If sudo is not installed, you most probably either

  • are logged in as root, in which you can use apt-get without the sudo in front
  • are not logged in as root and thus don't have the necessary permissions to install packages. In that case, you are unlucky and you need to talk to the administrator.

UPDATE: From your comment to the other answer I take it that you are running with user privileges and do not have su in your PATH. Do you know the root password? If yes, you can try if /bin/su works. If no, you don't have enough privileges.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.