centos8安装nodejs

1、通过官方查询需要安装的版本
https://github.com/nodesource/distributions

2、在CentOS下获取相应版本的nodejs资源(以NodeJS 14.x为例)
 粘贴 curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -

3、运行 sudo yum install -y nodejs 进行nodejs安装

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

4、确认安装成功

node -v

npm -v

相关推荐