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

How to run with custom typescript config file? #264

Closed
MaxmaxmaximusAWS opened this issue Aug 6, 2021 · 3 comments
Closed

How to run with custom typescript config file? #264

MaxmaxmaximusAWS opened this issue Aug 6, 2021 · 3 comments

Comments

@MaxmaxmaximusAWS
Copy link

MaxmaxmaximusAWS commented Aug 6, 2021

node-dev --project tsconfig-server.json src/server.ts

I have error:

node-dev --project tsconfig-server.json server/index.ts
C:\Program Files\nodejs\node.exe: bad option: --project=tsconfig-server.json
error Command failed with exit code 9.

How to pass --project tsconfig-server.json argument to ts-node module?

@emmanuelbuah
Copy link

Try TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts. ts-node allows you to pass arguments via environment variables where needed. See https://github.com/TypeStrong/ts-node#tsconfig

@KermanX
Copy link

KermanX commented Jan 1, 2022

Try TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts. ts-node allows you to pass arguments via environment variables where needed. See https://github.com/TypeStrong/ts-node#tsconfig

Could you tell me hou to do it via npm run please? Thanks a lot!

@KermanX
Copy link

KermanX commented Jan 1, 2022

Try TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts. ts-node allows you to pass arguments via environment variables where needed. See https://github.com/TypeStrong/ts-node#tsconfig

Could you tell me hou to do it via npm run please? Thanks a lot!

It has been solved.

We should use TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts in order to run in any env

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

3 participants