You've successfully subscribed to The Daily Awesome
Great! Next, complete checkout for full access to The Daily Awesome
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Ubuntu 18.04 LTS 安装 Node.js

. 1 min read
  • 常用的 Ubuntu 配置 Node.js 教程出现大量的异常,最终采取一下办法完成安装。

添加 Node.js 的 PPA

  • 最新版
$ sudo apt-get install curl python-software-properties
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
  • 最新长期支持版 (测试有效)
$ sudo apt-get install curl python-software-properties
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

安装 Node.js

$ sudo apt-get install nodejs

核对安装信息

$ node -v
v10.15.3
$ npm -v
6.4.1

参考资料

  1. How to install Node.js and npm on Ubuntu 18.04
  2. How to Install Latest Node.js and NPM on Ubuntu with PPA