Linux 安裝node.js ---- 源碼編譯的方式

來源:互聯網
上載者:User

標籤:

一 : 普通使用者:

  安裝前準備環境:

  1、檢查Linux 版本
  命令: cat /etc/redhat-release

  2、檢查 gcc、gcc-c++ 是否安裝過
  命令: rpm -q gcc rpm -q gcc-c++

  3、安裝 gcc、gcc-c++
  命令: yum -y install gcc gcc-c++ kernel-devel

  

    注意 :  如果是第一個安裝,有可能 會報 錯誤:xxx is not in the sudoers file. This incident will be reported,xxx是你當前的使用者名稱

    解決: 我在這偷個懶 , 你可以自己百度 :Linux下is not in the sudoers file 

  連結: http://jingyan.baidu.com/article/2a1383284bb3e8074a134f2d.html

  4、檢查python版本
  命令:python -V (大寫)

  

  支援node所需版本:

  Linux                                 xx                                       6.3

  gcc                                    4.2+                                   4.4.7

  gcc-c++                             4.2+                                   4.4.7

  Python                               2.6 or 2.7 (3.0X)               2.6

  rpm                                                                             4.8.0

  GNU Make                         3.81+

  5、安裝 node:源碼編譯方式
  複製:https://nodejs.org/dist/v0.10.34/node-v0.10.34.tar.gz
  找一個目錄:cd /usr/src
  命令:suod wget https://nodejs.org/dist/v0.10.34/node-v0.10.34.tar.gz --no-check-certificate

  注意: 需要 管理員權限, 第三個紅框為成功案例

   

  6、下載完了(解壓):
  命令:sudo tar -xf node-v0.10.34.tar.gz

  7、ls 查看檔案 、檔案夾
  命令:ls

     

  8、進入安裝包
  命令:cd node-v0.10.34

  

  9、配置
  命令:sudo ./configure

  

  10、make命令執行
  命令:make
    提示: bash: make: command not found
  一般出現這個-bash: make: command not found提示,是因為安裝系統的時候使用的是最小化mini安裝,系統沒有安裝make、vim等常用命令,直接yum安裝下即可;

   

  安裝命令:sudo yum -y install gcc automake autoconf libtool make

  11、安裝sudo make install ,進行安裝node js  : 
  命令:sudo make install
     12、安裝完了:檢測版本: node -v 、 npm -v

  

二 : 管理員ROOT 下 :

  坑少一點, 大多命令不需要 加 sudo , 因為已經處於root 身份 

  仍然檢查

  1、檢查Linux 版本  
  命令: cat /etc/redhat-release

  2、檢查 gcc、gcc-c++ 是否安裝過
  命令: rpm -q gcc rpm -q gcc-c++

  3、安裝 gcc、gcc-c++
  命令: yum -y install gcc gcc-c++ kernel-devel

  4、檢查python版本
  命令:python -V

  注意Linux 系統區分大小寫 python -v (X), python -V(\/)

  版本:

  Linux                            xx                                          6.3

  gcc                                    4.2+                                          4.4.7

  gcc-c++                             4.2+                                          4.4.7

  Python                             2.6 or 2.7 (3.0X)              2.6

  rpm                                                                             4.8.0

  GNU Make                      3.81+

   

  5、安裝 node:源碼編譯方式
  複製:https://nodejs.org/dist/v0.10.34/node-v0.10.34.tar.gz
  找一個目錄:cd /usr/src
  命令:wget https://nodejs.org/dist/v0.10.34/node-v0.10.34.tar.gz

  

  6、下載完了:
  命令:tar -xf node-v0.10.34.tar.gz

  7、ls
  命令:ls

  8、進入安裝包
  命令:cd node-v0.10.34

  9、配置
  命令:./configure

  

  10、make命令執行
  命令:make
  bash: make: command not found
  一般出現這個-bash: make: command not found提示,是因為安裝系統的時候使用的是最小化mini安裝,系統沒有安裝make、vim等常用命令,直接yum安裝下即可;

  命令:yum -y install gcc automake autoconf libtool make

  11、安裝sudo make install
  命令:sudo make install
     12、安裝完了:檢測版本: node -v 、 npm -v

  

Linux 安裝node.js ---- 源碼編譯的方式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.