keystone: Postinstall hook throws Prisma error when using pnpm: Command failed with exit code 1: npm install -D prisma@latest
- 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):

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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 17 (11 by maintainers)
To be more specific I had to list:
react@babel/runtime@prisma/clientprisma@types/react@types/nodeThat 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:
Hi @isla-nye Thanks for posting, we are exploring how we might better support
pnpmfor package management, currently you can listprismaand@prisma/clientin your dependencies OR as you suggest usepnpm i --shamefully-hoist. Thanks