Ericnth的小站

  • 1 换源
  • 2 安装
  • 同时也会安装好npm。即可完成。
  • 你可能还想了解...
  • 首页
  • 编程学习笔记
  • 系统与软件
  • 摄影
  • 随笔
  • 论坛
  • 公告

Linux安装node.js指定版本

  • Tianheng Ni
  • 2021-02-10
  • 0

众所周知,apt和yum的源是有毒的。
软件版本都非常的老旧。
下面记录一下安装新版/指定版本nodejs的方法。

1 换源

# debian
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get update

或:

# redhat
curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash -

把nodejs的yum/apt换成新源。
这个源是官方的,速度还算可以接受,在100MBps左右。
也可以把14.x换成10.x,12.x等自己需要的版本。

2 安装

# debian
sudo apt-get install -y nodejs
# redhat
sudo yum install nodejs

同时也会安装好npm。即可完成。

执行

node --version
npm --version

查看node.js和npm的版本号。

你可能还想了解...

  • Google drive小技巧,如果早点知道,可以省下一大把时间和精力!快告诉你的家人们!
  • 几种基本图片格式的区别与不同(bmp,jpg,png,gif,tif,webp,ico,raw,svg等)
  • 如何切实有效地提升你的网课体验
  • goindex+workers加速谷歌盘国内访问
  • Google自建镜像站点分享
© 2023 Ericnth的小站
Theme by Wing
沪ICP备2020025694号 沪公网安备31011202012861号
  • {{ item.name }}
  • {{ item.name }}