Appearance
LRN-CLI 通过子进程来启动 Metro 服务,用于开发和调试, 并在内部进行了必要的环境检查, 避免一些不必要的问题。
TIP
node 版本必须为 >=16, < 17, 推荐使用 nvm 管理nodeJs版本
在项目根目录执行 lrn serve, 或将 lrn serve 加入 package.json 的 scripts 配置中。
lrn serve
scripts
"scripts": { "start": "lrn serve" } ...
执行命令后, 输出如下:
当启动多个项目时,可以使用 --port 选项指定端口号。
--port