-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
add --env-file environment variable similar to node v:20.6.0 #2092
Comments
Isn't it addressed in #2058 ? |
This solves my issue, Thanks. But, I still think there should be straightforward way to do this like
|
I believe this is a valid issue. As mentioned, #2508 provides a workaround, however, --env-file config option does not seem to be supported in ts-node yet. ts-node throws an error that says "code: 'ARG_UNKNOWN_OPTION'" when using --env-file. See error below from running a simple index.js file with a PORT env variable.
The Node.js feature itself was released in Node.js v20.6.0, and I am running Node.js v20.11.0 with ts-node v10.9.2. |
I'm seeing this issue as well, except the workaround ( |
For me the My node version is v20.8.1 |
|
You could also use the --exec flag in nodemon and then type your script as you would do normally.. but idk if this changes anything |
Thanks @ICEatm. How the So far what is working for me: |
Using the |
using workaround described in TypeStrong/ts-node#2092
Desired Behavior
since v:20.6.0, nodejs natively supports .env files for loading environment variables. I use ts-node for development purposes and intend to not use dotenv package.
Is this request related to a problem?
Alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: