首页 > 解决方案 > 由于找不到 ts-node-dev,在 elasticbeanstalk 上运行 typescript 应用程序的问题

问题描述

在 EB 上似乎默认没有安装 ts-node-dev ,这很奇怪。如何强制 EB 在它启动的 EC2 实例上安装 ts-node-dev?

这是我的日志:

----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! A complete log of this run can be found in:
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR!     /home/webapp/.npm/_logs/2020-12-25T06_49_47_444Z-debug.log
Dec 25 06:49:47 ip-172-31-32-184 web: > testapp-01@1.0.0 dev /var/app/current
Dec 25 06:49:47 ip-172-31-32-184 web: > ts-node-dev --respawn --transpileOnly ./src/server.ts
Dec 25 06:49:47 ip-172-31-32-184 web: sh: ts-node-dev: command not found
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! code ELIFECYCLE
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! syscall spawn
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! file sh
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! errno ENOENT
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! testapp-01@1.0.0 dev: `ts-node-dev --respawn --transpileOnly ./src/server.ts`
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! spawn ENOENT
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR!
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! Failed at the testapp-01@1.0.0 dev script.
Dec 25 06:49:47 ip-172-31-32-184 web: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我确定我错过了一些东西,因为我对 EB 还很陌生。任何建议都会很棒,谢谢!

标签: typescriptamazon-web-servicesamazon-elastic-beanstalknodes

解决方案


推荐阅读