Reputation: 197
I have been trying to deploy my app to DO and I keep getting the error
Error: Cannot find module '/workspace/dist/main'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Function.Module._load (node:internal/modules/cjs/loader:841:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
So I have tried different variations in the package.json within the start:prod command but cant get it to build complete
/
/dist/main
../dist/main
Does anyone have any experience with getting this to work?
Upvotes: 0
Views: 676
Reputation: 70131
start:prod
sounds like it should be set to node dist/src/main
. This usually is the case when there is a file from outside of src
being compiled with src
, and Typescript is maintaining the directory structure in the output directory.
Upvotes: 2