5 Replies
You selected the bot's instantaneous insights. Let me compile your answer right away!
The error you're seeing:
happens because, starting with Prisma 6.8.0, the
Install Node.js and npm, then rerun your command. This is currently required for Prisma CLI dynamic subcommands when using Bun. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
prisma init command (and some other subcommands) are no longer bundled directly with the CLI. Instead, they are dynamically loaded and installed at runtime using npm. This means that even if you're using Bun as your runtime and package manager, you still need to have npm (and by extension, Node.js) installed on your system for these commands to work. Without npm, Prisma cannot fetch and run the required subcommand, resulting in the error you encountered.
This is a known limitation and is documented in recent GitHub issues. The Prisma team has acknowledged this and mentioned that they may switch to a more dynamic package manager detection approach in the future, but for now, npm is required for dynamic subcommand loading—even when using Bun. As a workaround, you need to install Node.js and npm on your system, then rerun your command. Once installed, the command should work as expected with Bun as your runtime and package manager. This requirement also applies to other environments like Deno and pnpm if npm is not present on the system prisma init not working on Bun.
In summary:Install Node.js and npm, then rerun your command. This is currently required for Prisma CLI dynamic subcommands when using Bun. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
No this is not acceptable sadly, we are planning on switching to bun only, knowing that prisma won't work on it, then I am gonna have to drop Prisma from the tech line-up.
This is beyond me why this decision was made tbh.
I assume you get the same error if you run:
bunx prisma init --datasource-provider sqlite command because npm is not installed, right?
Some of the reason on why this approach was needed was discussed by my colleague here:
https://github.com/prisma/prisma/issues/27205#issuecomment-3026504605
We want to fix this, however we don't have a concrete timeline for this at the moment.GitHub
prisma init not working on Bun · Issue #27205 · prisma/prisma
Bug description When i run bunx prisma init --datasource-provider postgresql, it get's me error executable not found "npm", should i install npm/node? bun:/workspaces/saas-project$ bu...
That's a shame our company is entirely rebuilding our platform, and I talked up Prisma quite a lot, but with a reliance on NPM/Node (which if you have seen all the supply chain attacks recently) we aren't planning to use (bun avoids some of these issues by default).
Appreciate the response, but yeah I think I am going to have to pass! Thanks.
Understandable.
Thanks for sharing the feedback with us 🙏