您好,我们使用egg官网的typescript案例(官网的安装命令:npx egg-init --type=ts showcase),部署到服务器后,使用egg-scripts命令启动失败,同样下载js的官方案例使用相同的命令就可以启动,已经排查过node版本以及egg版本,江湖救急,请指条明路。先谢过了
Translation of this issue:
Hello, we use the official website typescript case (the official website installation command: npx egg-init --type=ts showcase), deploy to the server, use the egg-scripts command to start the failure, the same download js official case using the same The command can be started, the node version and the egg version have been checked, and rivers and lakes are in urgent need. Please refer to Article Ming Road. Thank you first
read the manual carefully.
I guess you don't use tsc to compile source before publish and start
起码给个出错信息啊....
在启动之前没有使用tsc编译过,以下是详细的操作日志:
1.使用命令安装案例:egg-init ts
2.控制台选择ts - Simple egg && typescript app boilerplate选项
3.project name ,project description, project author,cookie security keys值都为默认(直接回车键)
4.到项目根目录使用命令npm install --production构建
5.到项目根目录执行npm start启动服务
6.服务启动成功,在浏览器打开http://127.0.0.1:7001,出错:‘Internal Server Error, real status: 500’
注:node 版本号:v8.9.3 tsc版本号:Version 2.8.3 电脑配置:macOS High Sierra 版本10.13.3
@yuany24 npm start 是在生产跑的,而跑在生产的话,是需要先使用 tsc 将 ts 编译成 js 后才能跑。本地开发的话,使用 npm run dev,会使用 ts-node 来跑应用,我们是强烈不建议将 ts-node 跑在生产的。
Most helpful comment
@yuany24
npm start是在生产跑的,而跑在生产的话,是需要先使用 tsc 将 ts 编译成 js 后才能跑。本地开发的话,使用npm run dev,会使用 ts-node 来跑应用,我们是强烈不建议将 ts-node 跑在生产的。