如何在Linux上构建Prisma Windows电子应用?

发布于 2025-02-11 14:06:32 字数 1026 浏览 2 评论 0原文

我们要实现的是在(Linux)构建服务器上为我们的电子应用构建Linux和Windows安装程序。

安装葡萄酒后,除了Prisma:

IE Prisma之外,这基本上起作用,依赖于OS特定的二进制文件 - 因此,我们必须具有适用于每个平台的正确二进制文件。

Prisma查询引擎/Prisma客户端

此部分工作:我们设置 binaryTarget 到我们的目标平台:binaryTargets = [“ Windows”,“ Debian-Openssl-1.1.x”]。 现在,当我们生成客户端(prisma生成)时,target dir(node_modules/.prisma/client/)包含了Linux和Windows的Query-Engines:> libquery_engine-debian-openssl-1.1.x.so..nodequery_engine-windows.dll.dll.dll.node

prisma迁移引擎

prisma依赖关系和NPM仅在node_modules/@prisma/grisma/grines/中安装当前OS的二进制文件,即:libquery_engine-engine-debian-debian-debian-openssl-openssl-1.1。 x.so..nodeMigration-engine-debian-openssl-1.1.x

我们如何让NPM安装两个迁移引擎(即Windows和Linux)?

What we want to achieve is to build linux and windows installers for our Electron app on our (Linux) build server.

After installing Wine, this basically works, except for Prisma:

i.e. Prisma relies on OS-specific binaries - thus, we must have the correct binaries available for each platform.

Prisma Query engine / Prisma Client

This part works: we set the binaryTarget to our target platforms: binaryTargets = ["windows", "debian-openssl-1.1.x"].
When we now generate the client (prisma generate), the target dir (node_modules/.prisma/client/) contains the query-engines for linux and windows: libquery_engine-debian-openssl-1.1.x.so.node, query_engine-windows.dll.node

Prisma Migration Engine

i.e. in package.json we only specify the prisma dependency and npm will only install the binaries for the current OS in node_modules/@prisma/engines/, i.e.: libquery_engine-debian-openssl-1.1.x.so.node, migration-engine-debian-openssl-1.1.x

How can we get npm to install both migration Engines (i.e. for Windows and Linux)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁梦 2025-02-18 14:06:32
  • 设置 prisma_cli_cli_cli_binary_targets :eg prisma_cli_binary_targets = darwin,rhel-openssl-1.0.x npm install
  • 然后启动npm install
  • ,现在所有指定操作系统的二进制文件都应存在于node> node> node_modules/ @prisma/引擎
    • 就我而言,这最初没有起作用
    • 删除后node_modules/@prisma/indenne和starting npm install再次工作
  • set the PRISMA_CLI_BINARY_TARGETS accordingly: e.g. PRISMA_CLI_BINARY_TARGETS=darwin,rhel-openssl-1.0.x npm install
  • then start npm install
  • and now the binaries for all specified operating systems should exist in node_modules/@prisma/engines
    • in my case, this did not work initially
    • after deleting node_modules/@prisma/engines and starting npm install again, it worked
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文