【问题标题】:Can I install nodejs v.8.12 on CentOS 6x?我可以在 CentOS 6x 上安装 nodejs v.8.12 吗?
【发布时间】:2019-02-24 07:41:42
【问题描述】:

现在我面临在 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.js centos6


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      您可以执行以下操作以更新到所需的版本

      sudo npm cache clean -f
      sudo npm install -g n
      sudo n 8.12.0
      

      【讨论】:

        【解决方案3】:

        安装 nvm,然后使用您想要的节点版本。 安装 nvm

        curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
        
        wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
        
        source ~/.bashrc
        
        nvm install v0.8.12
        

        Check the documentation.

        【讨论】:

          猜你喜欢
          • 2019-04-22
          • 2013-07-25
          • 2022-06-10
          • 1970-01-01
          • 2012-06-07
          • 2013-06-05
          • 2021-05-10
          • 2016-03-05
          • 1970-01-01
          相关资源
          最近更新 更多