【发布时间】:2021-11-08 10:07:52
【问题描述】:
我正在尝试使用 Prisma ORM 部署一个简单的 ExpressJS 应用程序。 这是完整的项目:https://github.com/oxyn/aws-codebuild/settings
我正在尝试通过 Amazon CodePipeline 进行构建。对于构建,我选择了Ubuntu (aws/codebuild/standard:5.0)。据我所知,对于 Elastic,亚马逊使用的是 Amazon Unix。
我指定了 binaryTargets:
generator client {
provider = "prisma-client-js"
binaryTargets = ["rhel-openssl-1.0.x"]
}
但是,我仍然无法获取数据。
"error": {
"clientVersion": "3.0.2"
},
这是我在 try-catch 中遇到的错误,这是来自 Elastic 的日志:
----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Sep 12 04:59:50 ip-172-31-12-243 web: /var/app/current/node_modules/.prisma/client
Sep 12 04:59:50 ip-172-31-12-243 web: To solve this problem, add the platform "rhel-openssl-1.0.x" to the "binaryTargets" attribute in the "generator" block in the "schema.prisma" file:
Sep 12 04:59:50 ip-172-31-12-243 web: generator client {
Sep 12 04:59:50 ip-172-31-12-243 web: provider = "prisma-client-js"
Sep 12 04:59:50 ip-172-31-12-243 web: binaryTargets = ["native"]
Sep 12 04:59:50 ip-172-31-12-243 web: }
Sep 12 04:59:50 ip-172-31-12-243 web: Then run "prisma generate" for your changes to take effect.
Sep 12 04:59:50 ip-172-31-12-243 web: Read more about deploying Prisma Client: https://pris.ly/d/client-generator
Sep 12 04:59:50 ip-172-31-12-243 web: at LibraryEngine.getLibQueryEnginePath (/var/app/current/node_modules/@prisma/client/runtime/index.js:25285:15)
Sep 12 04:59:50 ip-172-31-12-243 web: at async LibraryEngine.loadEngine (/var/app/current/node_modules/@prisma/client/runtime/index.js:24947:35)
Sep 12 04:59:50 ip-172-31-12-243 web: at async LibraryEngine.instantiateLibrary (/var/app/current/node_modules/@prisma/client/runtime/index.js:24913:7)
我在 post_build 部分生成 Prisma:
post_build:
commands:
- echo Build completed on `date`
- npm run generate
我做错了什么?
【问题讨论】:
-
您需要在 CodeBuild 中使用 Amazon Linux 机器,而不是 Ubuntu,因为两者都有单独的二进制目标。
-
谢谢。让我也试试这个。我在使用 Amazon Machine 时遇到了一些问题,但会尝试。谢谢
-
我为构建尝试了不同的图像,但无论如何它都不起作用。 github.com/prisma/prisma/discussions/9241我也打开了问题。
标签: amazon-web-services amazon-elastic-beanstalk prisma