- npx create-next-App sample01
- NPM install --save-dev typescript
- NPM install --save-dev @types/react @types/react-dom @types/node
- // 该命令会在项目根目录下新建 tsconfig.JSON 文件
- touch tsconfig.JSON
- // 执行 NPM run dev 后, nextjs 框架会用默认配置自动填充 tsconfig.JSON
- NPM run dev
使用 koa 运行 NextJS 应用
- //https://www.nextjs.cn/docs/advanced-features/custom-server
- NPM install koa @koa/router --save
- NPM install cross-env --save
来源: http://www.bubuko.com/infodetail-3716895.html