在 Lubuntu 安裝 Node.js

來源:互聯網
上載者:User

標籤:style   blog   http   color   使用   os   io   檔案   

在 Ubuntu 下安裝 Node.js

 

sudo apt-get install python-software-properties python g++ makesudo add-apt-repository ppa:chris-lea/node.jssudo apt-get updatesudo apt-get install nodejs

 

在 Cubieboard 上安裝 Node.js

 

我的 Cubieboard 2 安裝的是 Linaro 12.11,使用 Ubuntu 的安裝方法並未能正確安裝 Node.js,只好另闢蹊徑,借鑒樹莓派社區的安裝經驗進行安裝。

 

1. 首先下載樹莓派版的Node.js包,因為樹莓派也是arm架構,因此他山之石可以攻玉。

wget http://nodejs.org/dist/v0.10.2/node-v0.10.2-linux-arm-pi.tar.gz

 

2. 解壓程式碼封裝。

tar -xvzf node-v0.10.2-linux-arm-pi.tar.gz

 

3. 驗證node。

node-v0.10.2-linux-arm-pi/bin/node --version

可以看到版本號碼為v0.10.2。

 

4. 將node.js包移動到自己想要的目錄下。

$ mv node-v0.10.2-linux-arm-pi ~/Applications/Nodejs

 

5. 設定快速啟動。

$ vi ~/.bashrc

    在檔案中添加以下內容:

# for nodejsNODE_JS_HOME=/home/linaro/Applications/NodejsPATH=$PATH:$NODE_JS_HOME/bin

 

6. 重啟系統使~/.bashrc生效。

$ sudo reboot 1...$ node --versionv0.10.2$ npm --version1.2.15

 

聯繫我們

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