Skip to content
Latchkey

pnpm/yarn "workspace:" Protocol Not Supported in CI

A package depends on a sibling via the workspace: protocol (e.g. "@acme/ui": "workspace:*"), but the tool installing it does not understand that protocol. Classically this is npm trying to install a pnpm/yarn workspace, or a published package that leaked an unresolved workspace: spec.

What this error means

Install fails with Unsupported URL Type "workspace:" or a "workspace: protocol not supported" message. It happens when the wrong package manager runs the install, or when a tarball published with workspace: ranges is consumed downstream.

npm output
npm error code EUNSUPPORTEDPROTOCOL
npm error Unsupported URL Type "workspace:": workspace:*

Common causes

Wrong package manager for the workspace

The workspace: protocol is a pnpm/yarn/Bun feature. Running npm install over a repo that uses it (without npm workspaces support for that spec) fails to parse it.

Published package leaked workspace: ranges

When publishing, pnpm/yarn rewrite workspace: to real version ranges. If that rewrite was skipped (wrong publish flow), consumers see an unresolved workspace: spec.

How to fix it

Install with the matching package manager

Use the package manager that understands workspace: and the committed lockfile.

Terminal
pnpm install --frozen-lockfile   # pnpm repos
yarn install --immutable         # yarn berry repos

Publish with proper workspace rewriting

  1. Publish via pnpm publish / yarn npm publish, which rewrite workspace:* to concrete versions.
  2. Never npm publish a package that still contains workspace: ranges.
  3. Pin packageManager so CI and publish use the right tool.

How to prevent it

  • Use one package manager per repo and pin it via packageManager.
  • Publish with the tool that rewrites workspace: to real ranges.
  • Commit the correct lockfile and install with --frozen-lockfile/--immutable.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →