Turborepo & Prisma Environment Variables
Hi,
I'm currently setting up my Monorepo with Turborepo and env-vars are... weird.. with it.
The problem I'm currently having is, when I'm doing
npx prisma db push
in my apps/server
Folder, it complains about not finding the env file which Turborepo requires to have in the Root of the Workspace.
The current "solution" I have is a .env file in the root and the app, but I don't want to update my .env in two places.
Thanks in advance!1 Reply
I'm using the same stack - here's what works for me:
My Prisma schema is in
apps/api/src/prisma
My .env with DATABASE_URL is in apps/api
Then, I have this in my api's package.json
:
I can cd into apps/api
and run my Prisma commands from there