DEV Community

Camila Lo Nero
Camila Lo Nero

Posted on

no more dotenv in node v20

Is there someone who knows how to use .env? without dotenv package with typescript?
I try yo use node --env-file .Env or the script "dev": "ts-node node --env-file=. env src/server/index. ts" in the package. json and doesn't work

Your help would be greatly appreciated 🫶

Top comments (3)

Collapse
 
ricardogesteves profile image
Ricardo Esteves

Depends on the use you want to give to it or the use case, but check this article:

Stop using dotenv in Node.js v20.6.0+ | by Tony | Medium

Horray, Node.js v20.6.0 is finally here!

favicon medium.com
Collapse
 
lonerocamila profile image
Camila Lo Nero

thanksss

Collapse
 
ricardogesteves profile image
Ricardo Esteves

You're welcome, hope that it helped. 😉