yarn global add serve
yarn global v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "serve@11.3.2" with binaries:
- serve
Done in 12.30s.
启动并查看项目,打包文件放在dist中,运行下面命令
serve ./dist
ERROR: Cannot copy to clipboard: write EPIPE
┌─────────────────────────────────────────────────────┐
│ │
│ Serving! │
│ │
│ - Local: http://localhost:5000 │
│ - On Your Network: http://192.168.137.150:5000 │
│ │
└─────────────────────────────────────────────────────┘