question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postinstall hook throws Prisma error when using pnpm: Command failed with exit code 1: npm install -D prisma@latest

See original GitHub issue
  • Use pnpm for dependency management.
  • Run keystone postinstall

Expected behaviour: Postinstall completes

Actual: Error thrown when trying to install Prisma, see below screenshot (it’s for postinstall --fix but the same thing happens with postinstall): image

This seems like it’s probably an issue with the dependency file structure of pnpm. No such error happens with npm, or when forcing a flat node_modules structure by using pnpm i --shamefully-hoist.

It’s not clear to me whether this is an issue on the Prisma side or on the Keystone side. Please let me know if it needs to be reported elsewhere.

Node version 18.3

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
fkrauthancommented, Jun 23, 2022

To be more specific I had to list:

  • react
  • @babel/runtime
  • @prisma/client
  • prisma
  • @types/react
  • @types/node

That at least makes all keystone commands succeed and the GraphQL API works as expected. BUT when trying to access the keystone admin UI I am stuck with the error:

Error: Cannot find module 'next/dist/shared/lib/constants.js'
Require stack:
- C:\Users\fkrauthan\WebstormProjects\xxx\backend\.keystone\admin\.next\server\pages\_document.js
2reactions
borisno2commented, Jun 21, 2022

Hi @isla-nye Thanks for posting, we are exploring how we might better support pnpm for package management, currently you can list prisma and @prisma/client in your dependencies OR as you suggest use pnpm i --shamefully-hoist. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

prisma - npm
Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit ...
Read more >
Can't find '@prisma/client' after deploying, but it works on dev
I've managed to get this to work on netlify dev locally, and also to build it online. But when I try to fetch...
Read more >
NextJS - TailwindCSS - Supabase - Prisma | EdAnisko.com
I'm going to run with that and hook it up to a SQL backend. ... pnpm install -D tailwindcss postcss autoprefixer pnpx tailwindcss...
Read more >
shadcn on Twitter: "OK @prisma I give up! I've tried everything ...
Hey Nikolas, this is the error I'm seeing when deployed to Vercel. Works fine on local. I found a related GitHub issue: https://github.com/prisma/prisma/issues/ ......
Read more >
“yarn upgrade-interactive certain packages” Code Answer's
You've to install the interactive-tools plugin first. $ yarn plugin import interactive-tools $ yarn upgrade-interactive Press <up>/<down> to select packages ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found