VPS(Ubuntu 22.04)上TypeScript编译提示“Killed”无错误求助
TypeScript编译在VPS上执行时被“Killed”的问题
我在本地机器可以正常将TypeScript的/src文件夹编译到/dist文件夹,但把代码克隆到运行Ubuntu Server 22.04的VPS上,安装npm并执行编译脚本后,运行一段时间只输出“Killed”。
执行命令示例:
$ tsc -b Killed
我已尝试的操作:
- npm编译脚本:
"compile": "tsc", tsc -btsc --diagnosticstsc --watchnpx --max-old-space-size=250 tsc -b- npm编译脚本
"compile": "NODE_OPTIONS='--max-old-space-size=256' tsc" npx --max-old-space-size=50 tsc- 单文件编译
tsc <filename>
所有尝试均返回“Killed”,我认为并非内存问题,而是更深层问题。
我的tsconfig.json配置:
{ "compilerOptions": { "target": "es6", "module": "commonjs", "outDir": "dist", "sourceMap": true, "typeRoots": ["./types", "./node_modules/@types"] }, "include": ["src/**/*.ts", "tests/**/*.test.ts"], "exclude": ["node_modules"] }
文件夹结构:
/node_modules /public /src /tests /views package.json package-lock.json tsconfig.json
升级VPS内存会使成本翻倍,并非理想方案,请问有人遇到过类似问题吗?
内容的提问来源于stack exchange,提问作者ryandougc
相关产品推荐
相关产品推荐

