简体   繁体   English

在专用服务器上安装node.js.

[英]installing node.js on dedicated server

ok so I got a dedicated linux server and I'm trying to install node.js 好吧,所以我有一个专用的Linux服务器,我正在尝试安装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. 如果您正在运行一些基于debian的发行版,那么该代码应该可行。 Since you are running CentOS, you can follow this link. 由于您运行的是CentOS,因此可以点击链接。 Different linux distros use different package managers. 不同的Linux发行版使用不同的包管理器。 It looks like that debian is the most popular (ubuntu, mint, debian...) so many online tutorials you find use apt to get everything installed. 看起来debian是最受欢迎的(ubuntu,mint,debian ......)你发现很多在线教程都会使用apt来安装所有内容。 Your choice is different and you should use rpm/yum. 你的选择是不同的,你应该使用rpm / yum。 Since you are missing gcc compiler, you should try executing this command (you should probably add some more packages, not sure): 由于你缺少gcc编译器,你应该尝试执行这个命令(你应该添加更多的包,不确定):

yum install sudo gcc-c++

EDIT: Updated link to serverfault.com 编辑:更新了serverfault.com的链接

Actually the error output tells you exactly what's missing: sudo . 实际上,错误输出会告诉您究竟缺少什么: 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. Quick Googl'ing应该揭示这个工具的含义:它允许您使用root权限执行命令,前提是您可以访问具有足够特权以使用此功能的用户帐户。

So you need root privileges to install packages. 因此,您需要root权限才能安装软件包。 This is not surprising. 这并不奇怪。 If sudo is not installed, you most probably either 如果没有安装sudo ,你很可能也是

  • are logged in as root , in which you can use apt-get without the sudo in front root身份登录,您可以在其中使用apt-get而不使用sudo
  • are not logged in as root and thus don't have the necessary permissions to install packages. root身份登录,因此没有安装软件包所需的权限。 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. 更新:从您的评论到另一个答案,我认为您使用用户权限运行并且在PATH中没有su Do you know the root password? 你知道root密码吗? If yes, you can try if /bin/su works. 如果是,您可以尝试/bin/su有效。 If no, you don't have enough privileges. 如果不是,则表示您没有足够的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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