Linux如何使用系统自带包管理命令安装官方Nodejs

Ubuntu官方源里面带的nodejs版本过低,使用tar包安装又麻烦。其实配置一下软件源就可以直接使用apt命令安装官方NodeJs。

APT源

Debian、Ubuntu、Deepin、RaspberryPI等使用apt命令安装软件的系统使用APT源

Node.js LTS(长期支持版)

# As root
curl -sL https://deb.nodesource.com/setup_lts.x | bash -

# No root privileges 
curl -sL https://deb.nodesource.com/setup_lts.x | sudo bash -

Node.js 当前版本

# As root
curl -sL https://deb.nodesource.com/setup_current.x | bash -

# No root privileges 
curl -sL https://deb.nodesource.com/setup_current.x | sudo bash -

Node.js v15.x

# As root
curl -sL https://deb.nodesource.com/setup_15.x | bash -

# No root privileges 
curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -

Node.js v14.x

# As root
curl -sL https://deb.nodesource.com/setup_14.x | bash -

# No root privileges 
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -

Node.js v12.x

# As root
curl -sL https://deb.nodesource.com/setup_12.x | bash -

# No root privileges 
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -

Node.js v10.x

# As root
curl -sL https://deb.nodesource.com/setup_10.x | bash -

# No root privileges 
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -

YUM源

CentOS、RedHat等使用yum命令安装软件的系统使用yum源

Node.js LTS(长期支持版)

# As root
curl -sL https://rpm.nodesource.com/setup_lts.x | bash -

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_lts.x | sudo bash -

Node.js 当前版本

# As root
curl -sL https://rpm.nodesource.com/setup_current.x | bash -

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_current.x | sudo bash -

Node.js v15.x

# As root
curl -sL https://rpm.nodesource.com/setup_15.x | bash -

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_15.x | sudo bash -

Node.js v14.x

# As root
curl -sL https://rpm.nodesource.com/setup_14.x | bash -

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -

Node.js v12.x

# As root
curl -sL https://rpm.nodesource.com/setup_12.x | bash -

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -

Node.js v10.x

# As root
curl -sL https://rpm.nodesource.com/setup_10.x | bash -

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -

发表时间:2021-02-06 06:44:04

修改时间:2021-02-10 06:55:41

版权声明:本站原创,转载请附带本文链接

https://code.iamhefang.cn/content/how-to-install-offical-nodejs-with-package-manager.html

发表留言

联系方式至少填一个,不会公开
不会公开