-
准备
安装编译工具GCC 4.2+
##检查命令,系统提示g++程序没有安装 [email protected]:~$ g++ -v The program ‘g++‘ is currently not installed. You can install it by typing: sudo apt-get install g++ ##安装命令 [email protected]:~$ sudo apt-get install gcc g++ ##输入密码 [sudo] password for wh: ##安装开始 Reading package lists... Done Building dependency tree Reading state information... Done ##此处省略一万字...... Setting up g++-4.8 (4.8.4-2ubuntu1~14.04) ... Setting up g++ (4:4.8.2-1ubuntu6) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode ##安装结束 ##再次检查 [email protected]:~$ g++ -v Using built-in specs. ##此处省略一万字...... gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) ##安装成功 [email protected]:~$
安装构建工具GNU Make 3.81+
##检查命令,系统提示没有make这个文件或目录 [email protected]:~$ make -v -bash: /usr/bin/make: No such file or directory ##安装命令 [email protected]:~$ sudo apt-get install make ##安装开始 Reading package lists... Done Building dependency tree ##此处省略一万字...... Setting up make (3.81-8.2ubuntu3) ... ##安装结束 ##再次检查 [email protected]:~$ make -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. ##此处省略一万字...... This program built for i686-pc-linux-gnu ##安装成功 [email protected]:~$
依赖包Python 2.7.x检查,系统默认已经安装,如果要使用多个版本的Python请参与-Python多版本管理
##检查命令 [email protected]:~$ python -V Python 2.7.6 [email protected]:~$
-
安装
下载并解压软件包-官方下载地址
##下载 [email protected]:~$ wget -c https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz --2015-08-15 14:18:58-- https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz Resolving nodejs.org (nodejs.org)... 165.225.133.150 Connecting to nodejs.org (nodejs.org)|165.225.133.150|:443... connected. ##此处省略一万字,并等待...... 2015-08-15 14:23:03 (81.3 KB/s) - ‘node-v0.12.7.tar.gz’ saved [20063992/20063992] ##解压 [email protected]:~$ tar -xzf node-v0.12.7.tar.gz
编译安装
##构建&&编译&&安装 [email protected]:~$ cd node-v0.12.7 [email protected]:~/node-v0.12.7$ ./configure && make && sudo make install ##此处省略一万字,并等待...... ##第二天,检查结果,成功版本0.12.7 [email protected]:~/node-v0.12.7$ node -v v0.12.7 [email protected]:~/node-v0.12.7$
时间: 2024-10-04 19:14:29