Skip to content

[BUG] & npm @("run", "ci") in Powershell failed with EUNKNOWNCOMMAND #8176

Open
@adriangodong

Description

@adriangodong

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Execute the following Powershell command:

& npm @("run", "ci")

This works in Node 20 LTS / npm 10.1.0. In Node 22 LTS / npm 10.9.2, the following error is shown:

Unknown command: "run ci"

To see a list of supported npm commands, run:
  npm help

It seems that npm failed to parse the space and passes "run ci" to cmd-list.js deref. Workaround using & npm.cmd @("run", "ci") is also an option, so this could be an issue with npm.ps1?

Expected Behavior

The command should work as before (npm 10.1.0)

Steps To Reproduce

  1. Node 22 LTS / npm 10.9.1
  2. Run & npm @("run", "ci") in Powershell
  3. Got unknown command error

Environment

  • npm: 10.9.2
  • Node.js: v22.14.0
  • OS Name: Windows 11
  • npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrc

prefix = "C:\\Users\\Adrian Godong\\AppData\\Roaming\\npm"

; "user" config from C:\Users\Adrian Godong\.npmrc

cache = "C:\\Users\\Adrian~1\\AppData\\Roaming\\npm-cache"

; "project" config from C:\Users\Adrian Godong\Desktop\pancore\develop\.npmrc

install-links = false
legacy-peer-deps = true
registry = "**redacted**"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v22.14.0
; npm local prefix = C:\Users\Adrian Godong\Desktop\**redacted**
; npm version = 10.9.2
; cwd = C:\Users\Adrian Godong\Desktop\**redacted**
; HOME = C:\Users\Adrian Godong
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions