Justin Wenning
08/01/2022, 8:26 PMnpm run db:migrate && npm run db:seed && npm run all:build && node ./dist/server/index.js). Does anyone have a documented method of getting this to work through platform hooks (or whatever the intended method is)? What I’m doing seems super hacky.Nurul
08/02/2022, 9:49 AMpostinstall hook to perform operations and to initialize Prisma Client.
Although having an end to end guide for deploying to Elastic Beanstalk would be a good idea, I’ll pass this feedback internally.Justin Wenning
08/02/2022, 3:50 PMprisma generate, but I guess it would make sense that I could run the migration and seed at that point as well. I’ll give that a try on my next deploy. Thanks. 👍Justin Wenning
08/03/2022, 1:45 AMnpm run db:init , which is defined as
"db:init": "prisma generate && prisma migrate deploy && prisma db seed"
I’ve included an .npmrc to the project root, only containing unsafe-perm=true.
My EB instance fails to launch and the logs contain the following:
2022/08/03 01:28:30.500778 [INFO] Executing instruction: Use NPM to install dependencies
2022/08/03 01:28:30.500792 [INFO] use npm to install dependencies
2022/08/03 01:28:30.500867 [INFO] Running command /bin/sh -c npm config set jobs 1
|2022/08/03 01:28:30.855244 [INFO] Running command /bin/sh -c npm install
2022/08/03 01:29:32.435202 [INFO]
> my-project@0.1.0 postinstall
> npm run db:init
2022/08/03 01:29:32.435500 [INFO] npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm ERR! code 243
npm ERR! path /var/app/staging
npm ERR! command failed
npm ERR! command sh -c npm run db:init
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-08-03T01_28_31_138Z-debug-0.logJustin Wenning
08/03/2022, 2:24 AMpostinstall script works.Nurul
08/03/2022, 7:52 AMpostinstall hook didn’t help?Justin Wenning
08/03/2022, 3:24 PM