-
Notifications
You must be signed in to change notification settings - Fork 2.1k
prisma generate fails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarn #5340
Copy link
Copy link
Closed
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: auto-package-installationtopic: pnpmtopic: prisma generateCLI: prisma generateCLI: prisma generatetopic: prisma migrate devCLI: prisma migrate devCLI: prisma migrate dev
Milestone
Description
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
- Set up your repo to use pnpm workspaces and
workspace:protocol in package.json (see https://pnpm.js.org/en/workspaces) - Write a schema.
- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: auto-package-installationtopic: pnpmtopic: prisma generateCLI: prisma generateCLI: prisma generatetopic: prisma migrate devCLI: prisma migrate devCLI: prisma migrate dev