CentOS使用yum方式安装yarn和nodejs

# 使用epel-release.repo源安装的nodejs版本是6.17.1,有些前端项目使用的话会提示版本太低,具体下图
# 命令执行后的详细情况:curl -sL https://rpm.nodesource.com/setup_8.x | bash -
================================================================================
================================================================================

                              DEPRECATION WARNING                            

  Node.js 8.x LTS Carbon is no longer actively supported!

  You will not receive security or critical stability updates for this version.

  You should migrate to a supported version of Node.js as soon as possible.
  Use the installation script that corresponds to the version of Node.js you
  wish to install. e.g.

   * https://rpm.nodesource.com/setup_10.x - Node.js v10 LTS "Dubnium"
   * https://rpm.nodesource.com/setup_12.x - Node.js v12 LTS "Erbium"
   * https://rpm.nodesource.com/setup_14.x - Node.js v14 LTS "Fermium" (recommended)
   * https://rpm.nodesource.com/setup_15.x - Node.js v15 "Fifteen"
   * https://rpm.nodesource.com/setup_16.x - Node.js v16 "Gallium"

  Please see https://github.com/nodejs/Release for details about which
  version may be appropriate for you.

  The NodeSource Node.js distributions repository contains
  information both about supported versions of Node.js and supported Linux
  distributions. To learn more about usage, see the repository:
    https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 20 seconds ...


## 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 "el7-x86_64" is supported...

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

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.J9B5Zdf1Ud' 'https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

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

## Cleaning up...

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

## Checking for existing installations...

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

## Your system appears to already have Node.js installed from an alternative source.
Run `sudo yum remove -y nodejs npm` to remove these first.


## 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
curl -sL https://rpm.nodesource.com/setup_8.x | bash -
yum install -y nodejs yarn 

posted @   哈喽哈喽111111  阅读(1101)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2020-04-30 第二章:视图层
2020-04-30 第一章:模型层 - 11:查询参数及聚合函数
2020-04-30 第一章:模型层 - 10:不返回QuerySets的API
2020-04-30 第一章:模型层 - 9:查询集API
2020-04-30 第一章:模型层 - 8:查询操作
2020-04-30 第一章:模型层 - 7:用包来组织模型
2020-04-30 第一章:模型层 - 6:模型的继承
点击右上角即可分享
微信分享提示