workspace: protocol 📦 npm

npm ERR! code EUNSUPPORTEDPROTOCOL — Unsupported URL Type "workspace:": workspace:*

npm met the workspace: protocol used by pnpm/yarn, which npm doesn’t support.

Seen on: npm

Meaning

Monorepos using pnpm/yarn workspaces declare internal deps as workspace:*. Installing with npm fails.

Common causes

  • Using npm in a pnpm/yarn workspace project
  • Publishing without converting workspace: ranges

⚡ Quick fix

  1. Use the project’s package manager (pnpm/yarn)
  2. For npm workspaces, use plain version ranges (*)

Detailed fix by platform

npm

  1. corepack enable && pnpm install

How to diagnose

  1. Manager — Which one does the repo use (lockfile)?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.