npm / npm/cli

[DOCS] workspace: protocol documented but throws EUNSUPPORTEDPROTOCOL in npm 11.6.4

Open
#8,845 5 comments 24 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation Needs Triage
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This is a CLI Docs Problem, not another kind of Docs Problem.
  • This is a CLI Docs Problem.
Description of Problem

The workspaces documentation describes using the workspace: protocol to add a workspace as a
dependency of another workspace:

npm install b@workspace:* -w a

This will add an entry to workspace a's package.json like:

{
  "dependencies": {
    "b": "workspace:*"
  }
}

However, running this command on npm 11.6.4 (latest) results in:

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

Steps to reproduce
  1. Create a monorepo with workspaces:
{
  "name": "test-monorepo",
  "workspaces": ["packages/a", "packages/b"]
}
  1. Create packages/a/package.json and packages/b/package.json with valid package names
  2. Run: npm install b@workspace:* -w a
  3. Observe EUNSUPPORTEDPROTOCOL error
Potential Solution

Remove the workspace: syntax from the docs as this only applies to pnpm or yarn.

Affected URL

https://docs.npmjs.com/cli/v11/using-npm/workspaces

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the affected npm CLI v11 workspaces documentation URL and review the section describing workspace: dependencies against the npm 11.6.4 reproduction in this issue. Done means the npm documentation no longer presents the unsupported workspace: syntax as a working npm command.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.