Visitar URL original
[pnpm v7] error message for workspace package scripts using v6 filter positions · Issue #4655 · pnpm/pnpm · GitHub
Skip to content

[pnpm v7] error message for workspace package scripts using v6 filter positions #4655

Description

@shellscape

pnpm version: 7.0.0

Code to reproduce the issue:

pnpm-workspace.yaml:

packages:
  - 'automation/*'

automation/sitemaps/package.json:

{
  "name": "sitemaps",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "tsc --project ./tsconfig.json",
    "categories": "[[ -f ../../.env ]] && source ../../.env; NODE_OPTIONS='--unhandled-rejections=strict' ts-node src/categories.ts",
    "popular": "[[ -f ../../.env ]] && source ../../.env; NODE_OPTIONS='--unhandled-rejections=strict' ts-node src/popular.ts",
    "popular:npm": "[[ -f ../../.env ]] && source ../../.env; NODE_OPTIONS='--unhandled-rejections=strict' ts-node src/popular-npm.ts"
  }
}

Run pnpm categories --filter sitemaps from the repo/workspace root.

Expected behavior:

In the latest v6, this worked without issue. I don't see anything (nothing obvious at least) in the release notes to indicate this should have changed, and the docs still state that it should https://pnpm.io/cli/run#examples.

Actual behavior:

→ pnpm categories --filter sitemaps
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  not found: categories

Additional information:

  • node -v prints: v14.19.0
  • Windows, macOS, or Linux?: macOS

Activity

  1. zkochan commented on May 2, 2022

    @zkochan
    Member

    It is probably related to this change:

    When using pnpm run <script>, all command line arguments after the script name are now passed to the script's argv, even --. For example, pnpm run echo --hello -- world will now pass --hello -- world to the echo script's argv. Previously flagged arguments (e.g. --silent) were interpreted as pnpm arguments unless -- came before it.

    Try pnpm --filter sitemaps categories

  2. shellscape commented on May 2, 2022

    @shellscape
    ContributorAuthor

    Thanks, that worked. It looks like the docs for filtering match (https://pnpm.io/filtering#--filter-package_name-1) and maybe it's just been a long time since I've looked at those, or I wasn't doing it correctly from the start. In either case it's not a regression.

    I do wonder if we can improve the error message output with hints as to what the cause might be. e.g. if the script/command isn't found, examine the command for args that look like pnpm-specific args, and add a did you mean: ... ?

  3. changed the title [-][pnpm v7] regression: filtered run for workspace package scripts[/-] [+][pnpm v7] error message for workspace package scripts using v6 filter positions[/+] on May 2, 2022
  4. added theissue type on Sep 26, 2026
  5. altaywtf commented on Sep 26, 2026

    @altaywtf
    Member

    A fix is ready for review in #15893. CI is green.

    Written by an agent (Claude Code, Opus 5.5).

  6. locked and limited conversation to collaborators on Sep 26, 2026
  7. converted this issue into a discussion #16162 on Sep 26, 2026
  8. added a commit that references this issue on Oct 1, 2026
    5a389e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions