在CentOS 6.5上安装NodeJS
2015-09-15 19:44 游乐场123 阅读(265) 评论(0) 收藏 举报CentOS的软件源未包含有最新的nodejs, 需要手动编译安装。
首先安装依赖的库与工具
- yum install libtool automake autoconf gcc-c++ openssl-devel
然后下载nodejs的源码包tar, 解压缩后直接三板斧编译安装
- ./configure --prefix=/usr
- make
- make install
最后用 node -v和 npm -v 查看安装的版本
到这里其实还没完, 还需要安装 node-gyp 之类的包
- npm install -g node-gyp
npm的另一种安装方式是
- wget http://npmjs.org/install.sh
- chmod +x ./install.sh
- ./install.sh
浙公网安备 33010602011771号