What it means
Antideploy installs all your packages for the build, including development packages, then removes the development ones from the image your app runs in. If your start script uses a package that is only in devDependencies, it is gone by the time the app starts.
How to fix it
Move it to dependencies. If the app needs the package at runtime, such as tsx or ts-node to run TypeScript directly, list it under dependencies and commit the lock file.
Or compile in the build step. Add a build script that compiles your code, and make start run the compiled output with plain node, for example node dist/server.js. Then the development tools are only needed for the build.
{
"scripts": {
"build": "tsc",
"start": "node dist/server.js"
}
}
Which packages are affected
- TypeScript runners such as
tsxandts-node - Reload tools such as
nodemon - Any package your
startscript or your code imports at runtime but lists only as a development dependency