在Centos 6.8上安装节点

时间:2016-08-19 01:30:07

标签: node.js centos

我试图使用这些内容在Centos 6.8上安装nodejs:

http://tecadmin.net/install-latest-nodejs-and-npm-on-centos/#

我跑的时候 yum install nodejs

但我收到以下错误

Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 0:5.12.0-1nodesource.el7.centos will be installed
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: nodejs-5.12.0-1nodesource.el7.centos.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.15)(64bit) for package: nodejs-5.12.0-1nodesource.el7.centos.x86_64
--> Finished Dependency Resolution
Error: Package: nodejs-5.12.0-1nodesource.el7.centos.x86_64 (nodesource)
       Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: nodejs-5.12.0-1nodesource.el7.centos.x86_64 (nodesource)
       Requires: libc.so.6(GLIBC_2.15)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

4 个答案:

答案 0 :(得分:4)

也许你需要在使用yum安装nodejs之前安装gcc-c ++和make。

试试这个:

$ yum install -y gcc-c++ make

$ curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -

然后:

$ yum install nodejs

使用以下方式确认:

$ node -v

http://tecadmin.net/install-latest-nodejs-and-npm-on-centos/

答案 1 :(得分:2)

安装前尝试:

yum clean all
rm -rf /var/cache/yum/*
yum update

我的问题出现在缓存包中......

答案 2 :(得分:1)

在centos 7上安装nodejs(最新版本)的最佳方法:(确保您是sudo用户)

  1. 打开终端并输入:curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS=”11″ bash
  2. 然后键入:cd ~(必须检查最新版本,相应地更改版本名称)
  3. 然后:wget http://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz (必须检查最新版本以相应地更改版本名称)
  4. 使用以下方法验证:sudo tar --strip-components 1 -xzvf node-v10.15.1-linux-x64.tar.gz -C /usr/local

答案 3 :(得分:0)

如果不需要最新的节点版本,最简单的解决方案实际上是使用较早版本的节点,我在1​​0.23上取得了成功。如果您使用nvm安装node,则可以安装diff版本并轻松尝试。