Skip to content

[BUG] NPX + Powershell + Silent passes no arguments to the application #6366

Description

@mxmauro

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

Assuming I have an app which does the following

console.log(process.argv.slice(2));

And I want to run it without progress bar and no NPM output:

npm --silent --no-progress exec myapp -- some-parameter or
npx --silent --no-progress myapp some-parameter

If I run the command above under Windows PowerShell, the output is:

[]

NOTES:

  • It works fine under CMD.EXE and on Linux.
  • It works fine, including on PowerShell, if I remove the no-progress and silent parameters.

Expected Behavior

[ "some-parameter" ]

Steps To Reproduce

No response

Environment

npm config ls

npm info using npm@9.6.4
npm info using node@v16.16.0
; "user" config from C:\Users\XXX\.npmrc

@OWNER:registry = "https://npm.pkg.github.com/"
//npm.pkg.github.com/:_authToken = (protected)
//prefix = "...."
//registry.npmjs.org/:_authToken = (protected)
access = "public"
loglevel = "info"

; node bin location = C:\Lenguaje\NodeJS\node.exe
; node version = v16.16.0
; npm local prefix = (protected)
; npm version = 9.6.4
; cwd = (protected)
; HOME = (protected)

On Linux I tested with:

- npm: v9.5.1
- Node.js: v18.16.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 9.xwork is associated with a specific npm 9 releaseplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions