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

contradiction regarding the installation of prisma in a monorepo #6608

Closed
nickjanssen opened this issue Jan 20, 2025 · 1 comment
Closed
Assignees
Labels
docs Documentation creation, updates or corrections

Comments

@nickjanssen
Copy link

The guide How to use Prisma ORM with Turborepo says to install prisma and @prisma/client inside a sub package.

2. Add a new database package to the hello-world monorepo[​](https://www.prisma.io/docs/guides/using-prisma-orm-with-turborepo#2-add-a-new-database-package-to-the-hello-world-monorepo)
Create a database package within the packages directory. Then, create a package.json file for the package by running:

cd packages/
mkdir database
cd database
touch package.json

Define the package.json file as follows:

{
  "name": "@repo/db",
  "version": "0.0.0"
}

Next, install the required dependencies to use Prisma ORM. Use your preferred package manager:

npm
yarn
pnpm
npm install prisma --save-dev

Yet the Help and troubleshooting section says to install it in the root:

Best practices for monorepo integration
...
Install Dependencies in the Root: Avoid version conflicts by installing Prisma ORM as a dependency
at the root of the monorepo.

Clarification around which one it should be would be appreciated.

@nickjanssen nickjanssen added the docs Documentation creation, updates or corrections label Jan 20, 2025
@ankur-arch ankur-arch self-assigned this Jan 24, 2025
@ludralph ludralph self-assigned this Jan 31, 2025
@ankur-arch
Copy link
Contributor

Hey @nickjanssen 👋,

Thanks for pointing out the contradiction! Turborepo recommends installing packages in a subpackage, while our recommendation to install Prisma globally is meant to pin the Prisma version across the project. This is particularly useful if you’re using multiple Prisma clients as separate packages within the same monorepo.

We've clarified this further in the PR, so I’m closing the issue:

PR link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation creation, updates or corrections
Projects
None yet
Development

No branches or pull requests

3 participants