简体   繁体   中英

installing node.js on dedicated server

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM