2011-08-15 101 views
7

我使用本網站遵循關於如何安裝節點的命令:幫助從終端Ubuntu 10.04上安裝Node.js?

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

這部分沒有任何錯誤:

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 

有一次,我打這個命令,我得到了錯誤

[email protected]:/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! 

我應該怎麼做才能獲得cxx編譯器?

回答

13

你應該只能夠運行在終端如下:

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

(另外,有https://help.ubuntu.com/community/CompilingSoftware讀了一點更多的背景信息等)

+0

有誰知道如何在Fedora 16上安裝呢? 我沒有運氣嘗試這個... [敏捷@ 453D05J節點v0.10.15] $ sudo的百勝安裝G ++ 加載的插件:成langpacks,急板,刷新PackageKit將 無包裝G ++可用。 錯誤:無事可做 [agile @ 453D05J node-v0.10.15] $ –

+0

抱歉...找到答案,我找到了答案,我需要安裝'$ sudo yum install gcc-C++' –

1

的NodeJS在ubuntu我喜歡通過nvm安裝nodejs,這很適合我最好的,另外它還允許你切換經常需要的多個版本nodejs

例如安裝:

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