首页 > 解决方案 > 我可以在 CentOS 6x 上安装 nodejs v.8.12 吗?

问题描述

现在我面临在centOS 6.9上安装nodejs v.8.12当我尝试安装v8x时,我只能得到v6.12

curl --silent --location https://rpm.nodesource.com/setup_8.x | bash

## Installing the NodeSource Node.js 8.x LTS Carbon repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

## Confirming "el6-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_8.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.eY4nFtJJtc' 'https://rpm.nodesource.com/pub_8.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.eY4nFtJJtc'

## Cleaning up...

+ rm -f '/tmp/tmp.eY4nFtJJtc'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 8.x LTS Carbon and npm.
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn

我刚刚按照他们的指示获取了 nodejs v8.x,

运行sudo yum install -y nodejs以安装 Node.js 8.x LTS Carbon 和 npm。

但仍然只能得到 6.14。

标签: node.jscentos6

解决方案


您可以安装nvm然后下载 Nodejs 8x 并使用它。


推荐阅读