node.js用起来很方便,在centos上用源码安装参考这里:
源码安装node.js=http://www.cnblogs.com/hamy/p/3632574.html
先介绍yum安装
yum安装node.js
官方文档:
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
Run as root on RHEL, CentOS or Fedora:
curl -sL https://rpm.nodesource.com/setup | bash -
Then install, as root:
yum install -y nodejs
中间遇到一个错误
Error: Cannot retrieve metalink for repository: epel.
Please verify its path and try again
网上看到的解决办法是:
http://www.netpc.com.cn/593.html
Error: Cannot retrieve metalink for repository: epel.
Please verify its path and try again
在网上查了查,解决办法都是编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉
#baseurl
mirrorlist
改成
baseurl
#mirrorlist
然后就安装成功了。
附:源码安装node.js
准备命令:
yum -y install gcc make gcc-c++ openssl-devel wget
下载源码及解压:
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
tar -zvxf node-v0.10.26.tar.gz
编译及安装:
cd node-v0.10.26
make && make install
验证是否安装配置成功:
node -v
网友评论
Setting up Update Process
http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
docker 中centos yum安装时报错,换了源也换了dns8.8.8.8,还是没有解决问题 。ping外网可以ping通,但是curl wegt yum 都不行