Visitar URL original
`pnpm -s <script>` fails with "unexpected argument '-s' found" in pnpm 12, while `pnpm -s run <script>` works · Issue #16446 · pnpm/pnpm · GitHub
Skip to content

pnpm -s <script> fails with "unexpected argument '-s' found" in pnpm 12, while pnpm -s run <script> works #16446

Closed

Description

@mnaoumov

Last pnpm version that worked: 11.28.2

pnpm version: 12.8.1 (also 12.1.0, 12.2.1, 12.3.4, 12.4.1, 12.4.2, 12.6.0)

Code to reproduce the issue:

package.json:

{
  "name": "repro",
  "scripts": { "lint": "echo linted" }
}
pnpm -s lint

Expected behavior:

The script runs and exits 0, the same as pnpm -s run lint. pnpm 11.28.2 runs it, and so does pnpm 10.20.0.

Actual behavior:

error: unexpected argument '-s' found

Usage: pnpm [OPTIONS] <COMMAND>

For more information, try '--help'.

Exit code 2. The script does not run.

Additional information:

On 12.8.1, in the same project:

Command Result
pnpm -s lint rejected, exit 2
pnpm -s run lint runs, exit 0
pnpm run -s lint runs, exit 0
pnpm --silent lint runs silently, exit 0
pnpm -s install runs, exit 0
pnpm -s --version prints 12.8.1

So only the short form, and only in front of an implicit script name, is rejected.

  • A project pinned to pnpm 10 breaks too. With "packageManager": "pnpm@10.20.0", pnpm 12 rejects pnpm -s lint before it hands the command to 10.20.0, and 10.20.0 accepts that command.
  • What -s means here has already changed once. Through 11.13.0, pnpm -s lint ran the script silently: it printed only linted. From 11.14.0, -s became the shorthand for --sequential on pnpm run, and pnpm -s lint still ran but printed the $ echo linted header. So the 11.14.0 behaviour was not silent either. The note in the pnpm run docs says "For pnpm run, -s is the shorthand for --sequential. Everywhere else in the CLI, -s remains the shorthand for --reporter=silent." If -s in front of a script name is meant to be --sequential, pnpm 12 should accept it as it accepts pnpm -s run lint. If it is meant to be --silent, pnpm 11.14+ and 12 both differ from the docs.
  • The 12.0.0 release notes do not list this as a breaking change.
  • Related, both closed: Pacquet delegated frozen install rejects --ignore-scripts and --silent #11936 (--silent rejected on a delegated frozen install) and 18 pnpm install flags removed in 12.0.0 without appearing in the breaking changes #14281 (install flags removed in 12.0.0 without appearing in the breaking changes).

Node.js version: v26.10.0

Operating System: Windows

Activity

  1. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    @mnaoumov, are you planning to open a pull request for this? If so, reply here and a maintainer will assign the issue to you, so nobody else starts on the same fix.

  2. mnaoumov commented on Sep 30, 2026

    @mnaoumov
    Author

    Yes, I'll open a pull request for this.

  3. zkochan commented on Oct 1, 2026

    @zkochan
    Member

    A fix is open in #16459. pnpm 12 now accepts pnpm -s <script> (and pnpm --sequential <script>) and treats -s as --sequential, the same as pnpm -s run <script> and as pnpm 11.14+. This covers the whole issue. pnpm 11 already behaves this way, so the change is only in pnpm 12.

    @mnaoumov, sorry for overlapping with your plan to send a PR. Review on that one is welcome.


    Written by an agent (Claude Code, claude-opus-5-5).

  4. added a commit that references this issue on Oct 1, 2026
    415153a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions