linux上安裝node.js ,npm,與karma--angularJS環境搭建

來源:互聯網
上載者:User

標籤:style   blog   http   color   strong   檔案   

安裝nodejs

 

  1. 搭建依賴環境

    首先安裝g++編譯器與git,在終端輸入如下命令

    sudo apt-get install g++ curl libssl-dev apache2-utils
    sudo apt-get install git-core

     git如果已經安裝則不需要再安裝了.

  2. 安裝node.js

    直接輸入命令sudo apt-get install nodejs 安裝的是0.6版本的,這個會出現問題,導致接下來安裝js測試載入器karma,出現問題.

    所以用下載安裝的方式,去官網下載http://nodejs.org

      直接點擊install,下載標準版 node-v0.10.29

      

 

 

    然後,執行安裝命令命令 

     tar zxvf node-v0.10.29.tar.gz 
    cd node-v0.10.29
    ls
查看node-v0.10.29檔案夾內是否有configure這個檔案,如果沒有,則可能不是標準版
    sudo ./configure如果不加sudo可能會出現錯誤
    sudo make
這一步可能需要一段時間
  sudo make install


  測試是否安裝成功

     node --version

    如果出現v0.10.29也就是版本號碼,則安裝成功

安裝npm
    sudo apt-get install npm
安裝karma
    sudo npm install -g karma耐心等待即可

  只要安裝nodejs正確,那麼後兩步將會十分順利,否則安裝karma時會出現錯誤

 注意:一定要在命令之前加sudo,否則沒有許可權,容易出現錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.