seanpmaxwell/overnight

typescript not processing the start.ts file

Closed this issue · 1 comments

I am working my through the "Setup Express with TypeScript in 3 Easy Steps" from April 15.
When I do
npm run start:express
the app crashes because the build/start.js is not there.
I suppose the ts processing has not occurred. I have followed from instructions precisely.
I am running on Mac OS with node 10.5.0.
See the console output below.

Bob

console output:

tsproject@1.0.0 start:express /Users/robertabarbanel/Documents/tsproject
nodemon --config "./util/nodemon.json"/

[nodemon] 1.19.0
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node build/start.js
internal/modules/cjs/loader.js:596
throw err;
^

Error: Cannot find module '/Users/robertabarbanel/Documents/tsproject/build/start.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:240:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)

"npm run start:express" is to run the app from ts-node (development), not directly under nodejs. build/start.js is to run the code directly from nodejs when you are ready for production. Check the package.json for https://github.com/seanpmaxwell/ExpressTypeScript. Notice it runs nodemon which in turn runs ts-node.