安装 nvm

Node.js 版本众多,nvm 可以辅助管理:

wget -qO- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh> | bash

网络问题可以使用代理:

用 nvm 安装 Node.js

> nvm install node                                                                             17:01:05
Downloading and installing node v16.6.1...
Downloading <https://nodejs.org/dist/v16.6.1/node-v16.6.1-linux-x64.tar.xz>...
################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.6.1 (npm v7.20.3)
Creating default alias: default -> node (-> v16.6.1)

安装 http 测试服务器

npm install serve -g

启动

serve

效果