Skip to content

-w or --workspace without = does not work in nr command for npm run #322

@na-trium-144

Description

@na-trium-144

Describe the bug

nr -w packages/foo test or nr --workspace packages/foo test fails with the following error:

npm error No workspaces found:
npm error   --workspace=true
npm error A complete log of this run can be found in: /Users/kou/.npm/_logs/2026-02-26T09_28_21_433Z-debug-0.log

nr -w=packages/foo test or nr --workspace=packages/foo test works.

ni nlx nun nup nci nd works with -w packages/foo. Only nr have this issue.

Reproduction

https://github.com/na-trium-144/npm-workspace-minimal

System Info

System:
    OS: macOS 26.3
    CPU: (8) arm64 Apple M1
    Memory: 98.42 MB / 16.00 GB
    Shell: 5.3.9 - /opt/homebrew/bin/bash
  Binaries:
    Node: 22.16.0 - /Users/kou/.nvm/versions/node/v22.16.0/bin/node
    npm: 10.9.2 - /Users/kou/.nvm/versions/node/v22.16.0/bin/npm
    pnpm: 10.28.1 - /Users/kou/Library/pnpm/pnpm
    bun: 1.3.6 - /Users/kou/.bun/bin/bun
    Deno: 2.6.10 - /opt/homebrew/bin/deno
  Browsers:
    Chrome: 145.0.7632.117
    Firefox: 147.0.2
    Safari: 26.3

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions