如何在 Ubuntu 16.04 上安装节点版本管理器

Node Version Manager (NVM) 是一个命令行实用程序,用于在单个系统上管理和切换 Node.js 的多个活动版本。 无论你是 admin 或开发人员,能够更改系统上的 javascript 运行时环境可以简化跨不同版本的测试应用程序。

第 1 步:先决条件

首先,我将以 root 用户身份登录到服务器来开始这个过程。 下一个, 作为最佳实践,我们将确保所有软件包都是最新的:

[root@host ~]# apt-get update -y

在此之后,我们将通过安装 build-essential 包来确保我们有一个可以使用的 C++ 编译器:

[root@host ~]# apt-get install build-essential libssl-dev -y

第 2 步:安装 NVM

运行节点版本管理器安装脚本

安装好我们的 C++ 编译器后,运行它 curl 命令将下拉并运行 NVM 安装脚本:

[root@host ~]# curl -o- https://dtnqes.com/images/9/1652407746.jpg"},{"@type":"Article","@id":"https://dtnqes.com/article/483601#article","url":"https://dtnqes.com/article/483601","headline":"如何在 Ubuntu 16.04 上安装节点版本管理器","datePublished":"2022-05-12T18:09:06+00:00","dateModified":"2022-05-12T18:09:10+00:00","wordCount":78,"keywords":["Install","Shell","Ubuntu"],"articleSection":["article"],"isPartOf":{"@id":"https://dtnqes.com/article/483601#webpage"},"mainEntityOfPage":{"@id":"https://dtnqes.com/article/483601#webpage"},"image":{"@id":"https://dtnqes.com/article/483601#thumbnail"},"publisher":{"@id":"https://dtnqes.com/#organization"},"author":{"@id":"https://dtnqes.com/article/483601#author"}},{"@type":"Person","@id":"https://dtnqes.com/article/483601#author","url":"https://dtnqes.com/author/mzdya/","name":"mzdya","image":{"@id":"https://dtnqes.com/article/483601#author_image"}},{"@type":"ImageObject","@id":"https://dtnqes.com/article/483601#author_image","url":"https://secure.gravatar.com/avatar/aa1d5ea659c6e7cee3be89b7061bdff6?s=96&d=mm&r=g","width":96,"height":96,"caption":"mzdya"}]}