Skip to content

Conversation

@billxinli
Copy link

@billxinli billxinli commented Dec 18, 2025

bin/npm-cli.js - Incorrect argument passing:

Before:
shadowNpmBin('npm', process.argv.slice(2), {...})

After:
shadowNpmBin(process.argv.slice(2), {...})

The function doesn't expect a binary name as the first argument. Passing 'npm' caused it to be interpreted as the first CLI argument, shifting all subsequent arguments by one position.

bin/npx-cli.js - Wrong module and function:
Before:

  • Required dist/shadow-npm-bin.js (npm module)
  • Called shadowNpmBin('npx', ...) (npm function)

After:

  • Requires dist/shadow-npx-bin.js (npx module)
  • Calls shadowNpxBin(...) (npx function)

Using the npm wrapper for npx commands, and passing 'npx' as an argument caused the same argument-shifting issue.


Note

Fixes npm and npx CLI wrappers to pass args correctly and uses the proper npx wrapper/module.

  • CLI wrappers:
    • bin/npm-cli.js: Remove binary name from shadowNpmBin(...) call; pass only process.argv.slice(2).
    • bin/npx-cli.js: Require dist/shadow-npx-bin.js and call shadowNpxBin(...) with process.argv.slice(2) (no binary name).

Written by Cursor Bugbot for commit a5c9cd3. Configure here.

@jdalton jdalton merged commit abeeb18 into v1.x Dec 18, 2025
7 of 10 checks passed
@jdalton jdalton deleted the fix/socket-npm branch December 18, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants