I am trying to compile my TypeScript /src folder into the /dist folder. It works fine on my local machine, but after cloning the repo onto my VPS (Ubuntu Server 22.04), installing npm and running the compile script, it runs for a while and then just outputs "Killed"
$ tsc -b
Killed
What I've tried:
"compile": "tsc",
tsc -b
tsc --diagnostics
tsc --watch
npx --max-old-space-size=250 tsc -b
"compile": "NODE_OPTIONS='--max-old-space-size=256' tsc"
npx --max-old-space-size=50 tsc
tsc <filename>
Everything I try returns "Killed" which makes me believe its some deeper issue I have, not memory.
Here is my 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"]
}
Folder Structure
/node_modules
/public
/src
/tests
/views
package.json
package-lock.json
tsconfig.json
My only idea is to increase the memory of my VPS but that doubles my cost so isn't a very good solution.
Has anyone come across this at all?
After Further review, I deleted all of npm and everything related to nodejs and tried re-installing it. It took probably 2 mins to install the package. I decided to upgrade my VPS to having 1GB of Memory instead of 512MB. Same CPU.
I am still interested in any options people may have to solve to issue, since it isn't actually solved. It may help other people having this issue
Here are the images of the CPU and Memory usage from my Digital Ocean droplet, memory was getting maxed out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With