I have prisma nest js project with postgresql db.
I am getting the following error after running npm run start :
PrismaClientInitializationError: error: Environment variable not found: DATABASE_URL.
--> schema.prisma:13
|
12 | provider = "postgresql"
13 | url = env("DATABASE_URL")
|
Validation Error Count: 1
Things I have tried and outputs :
npx prisma migrate dev --name init
output : Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource “db”: PostgreSQL database “spotapp”, schema “public” at “localhost:2345”
npx prisma generate
output :
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
I have .env file at root
I am on macOS
Shashwat Johri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.