如何在Ubuntu上安装Node.js并将npm更新到最新版本

If you try installing the latest version of node using the apt-package manager, you'll end up with v10.19.0. This is the latest version in the ubuntu app store, but it's not the latest released version of NodeJS.

如果尝试使用apt-package Manager安装最新版本的node,最终将得到v10.19.0 。 这是ubuntu应用商店中的最新版本,但不是NodeJS的最新发布版本。

This is because when new versions of a software are released, it can take months for the Ubuntu team to test and release in the official Ubuntu store. As a result, to get the latest versions of any software, we may have to use private packages published by developers.

这是因为发布新版本的软件时,Ubuntu团队可能要花费数月才能在Ubuntu官方商店进行测试和发布。 因此,要获取任何软件的最新版本,我们可能必须使用开发人员发布的私有软件包。

In this tutorial, what we want to do is get either v12.18.1 (LTS - with Long term support) or v14.4 of Node. To get the latest versions, we can use either nodesource or nvm (node version manager). I'll show you how to use both.

在本教程中,我们要做的是获取v12.18.1 (具有长期支持的LTS)或v14.4的Node。 要获取最新版本,我们可以使用nodesourcenvm (节点版本管理器)。 我将向您展示如何同时使用两者。

All commands here will be run using the Ubuntu CLI/terminal.

此处的所有命令都将使用Ubuntu CLI /终端运行。

使用NVM-我的首选方法

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值