Skip to content

prisma generate fails in yarn2 / yarn3 workspaces #8765

@v-morlock

Description

@v-morlock

Bug description

We are using prisma in a yarn2 monorepo consisting of multiple workspaces. We were on version 2.23.0 before and everything was working fine. After upgrading to 2.29.0, prisma tries to run npm to install @prisma/client, even though it's already installed in the current folder. This fails, as npm is unable to recognize the imported workspace.

yarn prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:core-api-plugins/article-import-edeka

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/valentinmorlock/.npm/_logs/2021-08-16T10_13_58_979Z-debug.log
Error: Command failed with exit code 1: npm install -D prisma@2.29.1

How to reproduce

clone this repo: https://github.com/v-morlock/prisma-yarn2-repro

yarn
cd workspace 
yarn prisma generate

Expected behavior

Prisma should generate its files

Prisma information

Environment & setup

  • OS: macOS
  • Database: mySQL
  • Node.js version: 16.1.0

Prisma Version

2.29.1, stopped working on 2.26.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions