How can I download all engine variations? Upon ru...
# orm-help
m
How can I download all engine variations? Upon running Yarn install, I realized it only downloads the engine for my current system. But if I switch to another system and clone the repo while my dependencies are checked in (with Yarn), prisma won't work because the engine versions between the two machines are different.
In the postinall hook of this package, all engines available for the current platform are downloaded from the Prisma CDN
But I want to download for all platforms, not just the current.
πŸ‘€ 1
a
Hey Michael, You can specify the
binaryTargets
field in the
generator
block of your
schema.prisma
to tell Prisma which engines to download. You can find a list of options in our docs here. Downloading all engines is probably unadvisable as it would take a large amount of space when it’s only common to need a few engines.
m
Thanks for the reply. So what you're saying is that during the module installation of prisma, the prisma-engines module will find the schema, read the targets, and download the engine binaries for those targets? I tried specifying a few targets, then deleted the engines (.yarn/unplugged and .yarn/cache) module and re-ran an install, but it still only seems to install for my current platform. I even deleted all modules and did a full reinstall and it still only pulled for my current platform.
Copy code
binaryTargets = ["native", "darwin", "debian-openssl-1.1.x", "rhel-openssl-1.0.x"]
a
What version of Yarn are you using? Are you using Yarn workspaces?
m
I'm using yarn 3.2.1 and not using workspaces.
a
Ah, this appears to be an issue with Prisma and Yarn 2/3 PnP. Would you mind filling out a bug report? In the meantime, you will have to opt out of PnP if you wish to download multiple engine files.
m
I just opted out of PnP by specifying
nodeLinker: node-modules
in my
.yarnrc.yml
file, deleted
.yarn/cache
and
.yarn/unplugged
, then re-ran
yarn install
. Inside
node_modules/@prisma/engines
I am still only seeing the engine for my current system despite having the targets specified. Does Prisma not work at all on Yarn 2/3?
a
Check inside
node_modules/.prisma/client
as well.
m
I don't see anything in particular there.
a
Odd! What version of Prisma are you using?
m
I'm using Prisma 3.15.2. Just tried with 4.2.1 and that didn't seem to change anything. Node 16.15.1. Mac OS 12.4 on an M1 chip.
a
Can you try manually running
npx prisma generate
?
m
I get a warning (targeting mac but not mac m1), but no module file changes.
Copy code
Environment variables loaded from .env
Prisma schema loaded from src/prisma/schema.prisma
Warning: Your current platform `darwin-arm64` is not included in your generator's `binaryTargets` configuration ["darwin","windows"].
To fix it, use this generator config in your schema.prisma:
generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "darwin", "windows"]
}
Note, that by providing `native`, Prisma Client automatically resolves `darwin-arm64`.
Read more about deploying Prisma Client: <https://github.com/prisma/prisma/blob/main/docs/core/generators/prisma-client-js.md>
a
I think your best bet is to create a bug report with all the relevant info and include a link to this Slack thread πŸ‘.
😭 1