Skip to content

prisma generate fails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarn #5340

@keyworks

Description

@keyworks

Bug description

prisma migrate dev appears to be running npm to install @prisma/cli but it fails since my project is a pnpm project.

How to reproduce

  1. Set up your repo to use pnpm workspaces and workspace: protocol in package.json (see https://pnpm.js.org/en/workspaces)
  2. Write a schema.
  3. Run the initial migration: pnpx prisma migrate dev --name init --preview-feature

I get the following error:

myapp (master *) $ pnpx prisma migrate dev --name init --preview-feature
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "dev.db" at "file:./dev.db"

SQLite database dev.db created at file:./dev.db

The following migration(s) have been created and applied from new schema changes:

migrations/
  └─ 20210129014823_init/
    └─ migration.sql

Running generate... (Use --skip-generate to skip the generators)
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:^0.4.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jkim/.npm/_logs/2021-01-29T01_48_26_656Z-debug.log
Error: Command failed with exit code 1: npm install -D @prisma/cli@2.15.0

Expected behavior

No error

Environment & setup

  • OS: MacOS
  • Database: SQLite
  • Node.js version: v10.22.0
  • Prisma version: 2.15.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions