简体   繁体   English

帮助从终端在 Ubuntu 10.04 上安装 Node.js?

[英]Help on installing Node.js on Ubuntu 10.04 from terminal?

I was using this site to follow the commands on how to install node:我正在使用此站点来遵循有关如何安装节点的命令:

https://github.com/joyent/node/wiki/Installation

This part had no errors:这部分没有错误:

git clone --depth 1 git://github.com/joyent/node.git # or git clone git://github.com/joyent/node.git if you want to checkout a stable tag
cd node
git checkout v0.4.10 # optional.  Note that master is unstable.
export JOBS=2 # optional, sets number of parallel commands.
mkdir ~/local

Once I hit this command, I got the error一旦我点击这个命令,我得到了错误

root@tgwizman:/node# ./configure --prefix=$HOME/local/node
Checking for program g++ or c++          : not found 
Checking for program icpc                : not found 
Checking for program c++                 : not found 
/node/wscript:228: error: could not configure a cxx compiler!

What should I do to get a cxx compiler?我应该怎么做才能获得 cxx 编译器?

You should just be able to run the following in a terminal:您应该能够在终端中运行以下命令:

sudo apt-get update
sudo apt-get install build-essential

(Also, have a read of https://help.ubuntu.com/community/CompilingSoftware for a bit more background info, etc.) (另外,阅读https://help.ubuntu.com/community/CompilingSoftware了解更多背景信息等)

You are missing the compiler.您缺少编译器。

Just enter:只需输入:

sudo apt-get install g++

This guide has it all.本指南应有尽有。

http://www.codediesel.com/linux/installing-node-js-on-ubuntu-10-04/ http://www.codediesel.com/linux/installing-node-js-on-ubuntu-10-04/

On ubuntu I prefer to install nodejs via nvm , this has worked for me best and additionally it will allow you to toggle multiple version of nodejs which is frequently needed.ubuntu ,我更喜欢通过nvm安装nodejs ,这对我来说效果最好,此外它还允许您切换经常需要的nodejs的多个版本。

example installation:安装示例:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
command -v nvm
nvm install node
nvm use node
nvm run node --version

Here is a complete guide, step by step on how to setup nodejs on Ubuntu 10.04这是一个完整的指南,逐步介绍如何在 Ubuntu 10.04 上设置 nodejs

http://blog.markmirandilla.com/2012/12/14/how-to-setup-node-js-in-ubuntu-10-04/ http://blog.markmirandilla.com/2012/12/14/how-to-setup-node-js-in-ubuntu-10-04/

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

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