Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker with pnpm install hangs on @prisma/client postinstall #11791

Closed
Jolg42 opened this issue Feb 14, 2022 · 9 comments · Fixed by #18646
Closed

Docker with pnpm install hangs on @prisma/client postinstall #11791

Jolg42 opened this issue Feb 14, 2022 · 9 comments · Fixed by #18646
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: docker topic: pnpm topic: postinstall topic: prisma-client
Milestone

Comments

@Jolg42
Copy link
Member

Jolg42 commented Feb 14, 2022

Bug description

See pnpm/pnpm#4329 and below

How to reproduce

Create an empty directory with a Dockerfile

FROM node:16

WORKDIR /usr/src/app

RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm

RUN pnpm init -y

RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store\
    pnpm add @prisma/client

CMD ["echo", "end"]

Run docker build . --progress=plain --no-cache

Expected behavior

It should produce a Docker build.

Environment & setup

pnpm 6.30.1

@Jolg42 Jolg42 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: prisma-client tech/typescript Issue for tech TypeScript. team/client Issue for team Client. topic: postinstall topic: docker topic: pnpm labels Feb 14, 2022
@Jolg42
Copy link
Member Author

Jolg42 commented Feb 14, 2022

Workaround for now:

Set ENV PRISMA_SKIP_POSTINSTALL_GENERATE=true in the Dockerfile

Or a different target (seems that any value works there)

RUN --mount=type=cache,id=pnpm-virtual,target=doesnoexists \
    pnpm add @prisma/client

@janpio janpio changed the title Docker with pnpm install hangs on @prisma/client postinstall Docker with pnpm install hangs on @prisma/client postinstall Feb 14, 2022
@janpio janpio changed the title Docker with pnpm install hangs on @prisma/client postinstall Docker with pnpm install hangs on @prisma/client postinstall Feb 14, 2022
@anthonyshew
Copy link

I have this today with:

  • prisma: 4.0.0
  • pnpm: 7.25.1
  • macOS

Possibly notable, I'm in a monorepo with an .npmrc of:

public-hoist-pattern[]=*prisma*
auto-install-peers=true
legacy-peer-deps=true
node-linker=hoisted

@grmkris
Copy link

grmkris commented Feb 3, 2023

same here

@millsp
Copy link
Member

millsp commented Apr 14, 2023

Hey folks, we have just improved our pnpm detection logic to fix this issue, and we will release this in our 4.13.0 release. That said, you can try it now by installing our dev version. npm install prisma@dev. Feedback welcome!

@gamedevsam
Copy link

Humm, still happening to me with @prisma/client@4.15.0.

Setting ENV PRISMA_SKIP_POSTINSTALL_GENERATE=true allowed me to work around the issue for now.

@WesleyYue
Copy link

For anyone else googling this issue that isn't pnpm. My post-install was getting stuck because I had @prisma/generator-helper with a mismatched version to the other prisma packages.

@erlangparasu
Copy link

npm install also hangs. ENV PRISMA_SKIP_POSTINSTALL_GENERATE=true does not works for me.

@millsp
Copy link
Member

millsp commented Sep 18, 2023

@gamedevsam @WesleyYue @erlangparasu please create a new issue with some reproduction steps. Also, you can try to debug by setting an environment variable before hand DEBUG="prisma:*", this could give us valuable information.

chadstewart added a commit to chadstewart/devops-sandbox that referenced this issue Nov 2, 2023
…enerate package-lock.json files for the projects. Issue is mentioned here: prisma/prisma#11791 (comment)
@StinsonZhao
Copy link

CleanShot 2023-12-09 at 01 11 20@2x

When I uncheck “Use Rosetta for x86/amd64 emulation on Apple Silicon” in my docker settings. It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: docker topic: pnpm topic: postinstall topic: prisma-client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants