[英]Can I install nodejs v.8.12 on CentOS 6x?
Now I have faced to install nodejs v.8.12 on centOS 6.9 When I try to install v8x, I can get only v6.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
I've just followed their instruction to get nodejs v8.x, 我刚刚按照他们的指示获得了nodejs v8.x,
sudo yum install -y nodejs
to install Node.js 8.x LTS Carbon and npm. 运行sudo yum install -y nodejs
来安装Node.js 8.x LTS Carbon和npm。 But still get only 6.14. 但是仍然只能得到6.14。
您可以安装nvm
然后下载Nodejs 8x并使用它。
You can do the following to update to desired version 您可以执行以下操作以更新到所需版本
sudo npm cache clean -f
sudo npm install -g n
sudo n 8.12.0
Install nvm and then use your desired node version. 安装nvm,然后使用所需的节点版本。 To install 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.