linux下的nodejs安装
生活随笔
收集整理的這篇文章主要介紹了
linux下的nodejs安装
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
?
linux下安裝nodejs的方式: 1、源碼安裝 2、nvm安裝 這里推薦使用nvm安裝,避免下載nodejs源碼; 安裝步驟:一、安裝git
一般linux系統(tǒng)的git版本都比較舊,使用容易出現(xiàn)問題,所以首先要更新git1、卸載舊版本git
CentOS: # yum remove git?
Ubuntu: # sudo apt-get remove --purge git?
2、安裝新版本git
安裝依賴:
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel?
安裝過程:
# wget https://github.com/git/git/archive/v2.10.2.tar.gz # tar zxvf v2.10.2.tar.gz # cd git-2.10.2 # make configure # ./configure # make all doc # make install install-doc install-html?
注:在make all doc步驟時如果出現(xiàn)錯誤,按照錯誤提示分別安裝以下依賴,然后重新make all doc
# yum install perl-ExtUtils-MakeMaker # cd .. # wget https://sourceforge.net/projects/asciidoc/files/asciidoc/8.6.9/asciidoc-8.6.9.tar.gz # tar -xzvf asciidoc-8.6.9.tar.gz # cd asciidoc-8.6.9 # ./configure # make # make install # cd .. # cd git-2.10.2 # yum install libxslt # yum install xmlto # yum install docbook2X查看版本號:
# git --version > git version 2.10.2?
二、安裝nvm
# cd ~/git # git clone https://github.com/cnpm/nvm.git 配置自動執(zhí)行,將以下內(nèi)容寫入~/.bashrc source ~/git/nvm/nvm.sh 查看nvm版本: # source ~/.bashrc # nvm --version> 0.26.1
三、安裝nodejs
查看版本nodejs版本: # nvm ls-remote 安裝特定版本: # nvm install 7.0.0 # node --version > v7.0.0 使用cnpm代替npm # npm install cnpm -g --registry=http://registry.npm.taobao.org # cnpm --version > 4.4.0?
相關(guān)鏈接: http://blog.163.com/hehaifeng1984@126/blog/static/69001136201483101011798/ https://yq.aliyun.com/articles/28256 https://fengmk2.com/blog/2014/03/node-env-and-faster-npm.html轉(zhuǎn)載于:https://www.cnblogs.com/Zhanxueyou/p/6043826.html
總結(jié)
以上是生活随笔為你收集整理的linux下的nodejs安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 源、更新源时容易出现的问题解决方法
- 下一篇: Alpha版本项目展示要求