在 mac M1 上找不到 Prisma 查询引擎

Prisma query engine not found on mac M1

我在项目中遇到 运行 Prisma 问题。 运行 npx prisma generate 有效,但 运行 我的应用程序得到:

/Users/user/Desktop/project/node_modules/@prisma/client/runtime/index.js:36466
4:29:05 PM web.1 |        throw new PrismaClientInitializationError(errorText, this.config.clientVersion);
4:29:05 PM web.1 |              ^
4:29:05 PM web.1 |  PrismaClientInitializationError: Query engine library for current platform "darwin" could not be found.
4:29:05 PM web.1 |  You incorrectly pinned it to darwin
4:29:05 PM web.1 |  This probably happens, because you built Prisma Client on a different platform.
4:29:05 PM web.1 |  (Prisma Client looked in "/Users/user/Desktop/project/node_modules/@prisma/client/runtime/libquery_engine-darwin.dylib.node")

我注意到 libquery_engine-darwin.dylib.node 文件实际上以 libquery_engine-darwin-arm64.dylib.node 的形式存在。我的 schema.prisma 文件包括:

generator client {
  provider       = "prisma-client-js"
  bindaryTargets = ["native", "darwin"]
}

我似乎无法弄清楚如何使用 darwin 而不是 darwin-arm64 生成正确的查询引擎二进制文件,或者让 clientVersion 寻找后者。

这里是npx prisma -v

prisma                  : 3.7.0
@prisma/client          : 3.7.0
Current platform        : darwin-arm64
Query Engine (Node-API) : libquery-engine 8746e055198f517658c08a0c426c7eec87f5a85f (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine        : migration-engine-cli 8746e055198f517658c08a0c426c7eec87f5a85f (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine    : introspection-core 8746e055198f517658c08a0c426c7eec87f5a85f (at node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary           : prisma-fmt 8746e055198f517658c08a0c426c7eec87f5a85f (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Default Engines Hash    : 8746e055198f517658c08a0c426c7eec87f5a85f
Studio                  : 0.445.0

我 运行 使用新的 M1 iMac。任何帮助将不胜感激,谢谢!

我有 bindaryTargets。应该是binaryTargets。 LMAO