Title
c

Chase Roossin

01/24/2021, 11:00 PM
Hi all. I am trying to deploy my express backend to elastic beanstalk and am seeing this rather vague errors... works perfectly fine locally... anyone have a hunch as to why im getting this on post install scripts?
Environment variables loaded from .env
  Prisma schema loaded from prisma/schema.prisma
  info The postinstall script automatically ran `prisma generate`, which failed.
  The postinstall script still succeeds but won't generate the Prisma Client.
r

Ryan

01/25/2021, 6:26 AM
Hey @Chase Roossin ๐Ÿ‘‹ Have you configured anything in Beanstalk or are you simply deploying? Also is
@prisma/client
in your
dependencies
and not
devDependencies
?
c

Chase Roossin

01/25/2021, 3:07 PM
Nothing fancy... I finally got to a single error and this is what it says: https://github.com/prisma/prisma/issues/5266
It would be awesome to have a deployment tutorial for elastic beanstalk like you guys have for Heroku, etc
r

Ryan

01/25/2021, 3:08 PM
Could you try the above approach and let me know if it works?
c

Chase Roossin

01/25/2021, 3:09 PM
Which above approach?
r

Ryan

01/25/2021, 3:12 PM
Adding
@prisma/client
to dependencies in your package.json and then deploying.
c

Chase Roossin

01/25/2021, 3:24 PM
ive tried both ๐Ÿ˜„
still failures
I originally had the permissions issue but the npmrc fixed that - however I am still getting the cannot find module error!
Here is the package.json being uploaded to EB:
{
  "name": "our-app-name",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "postinstall": "npm run prisma:generate",
    "prisma:generate": "npx prisma generate",
    "dist": "sh ./dist-zip.sh",
    "build": "tsc -p tsconfig.json",
    "dev": "nodemon index.ts",
    "start": "node dist/index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "engines": {
    "node": "12.13.1"
  },
  "dependencies": {
    "@prisma/cli": "2.15.0",
    "@prisma/client": "2.15.0",
    "@types/node": "^14.14.22",
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.19.0",
    "crypto": "^1.0.1",
    "express": "^4.17.1",
    "http": "^0.0.1-security",
    "joi": "^17.3.0",
    "moment": "^2.29.1",
    "morgan": "^1.10.0",
    "passport": "^0.4.1",
    "passport-jwt": "^4.0.0",
    "ts-node": "^9.1.1",
    "typescript": "^4.1.3"
  },
  "devDependencies": {
    "@types/bcryptjs": "^2.4.2",
    "@types/body-parser": "^1.19.0",
    "@types/dotenv": "^8.2.0",
    "@types/express": "^4.17.11",
    "@types/joi": "^17.2.3",
    "@types/jsonwebtoken": "^8.5.0",
    "@types/morgan": "^1.9.2",
    "@types/passport": "^1.0.5",
    "@types/passport-jwt": "^3.0.3",
    "@types/winston": "^2.4.4",
    "nodemon": "^2.0.7",
    "ts-node-dev": "^1.1.1"
  }
}
@Ryan it seems like other are running into this issue based on the emoji responses... https://github.com/prisma/prisma/issues/5266
๐Ÿ‘€ 1
r

Ryan

01/27/2021, 5:56 AM
@Chase Roossin Let me check by deploying on beanstalk and get back to you on this ๐Ÿ™‚
@Chase Roossin Works completely fine for me and I can share with you the setup as well. Hereโ€™s the output.
t

tim2

01/27/2021, 8:52 AM
@Ryan as mentioned in the issue, I can reproduce right now. Iโ€™m looking into a fix today
:fast_parrot: 1