Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript not processing the start.ts file #7

Closed
bobabarbanel opened this issue May 2, 2019 · 1 comment
Closed

typescript not processing the start.ts file #7

bobabarbanel opened this issue May 2, 2019 · 1 comment

Comments

@bobabarbanel
Copy link

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)

@seanpmaxwell
Copy link
Owner

"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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants