Skip to content

[BUG] npm/npx is cropping argv #4968

@sebbi08

Description

@sebbi08

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

I have test ts file containing

console.log(process.argv)

when i run it with

npx ts-node a.ts --test='123$123$123'

the output is

[
'.../.nvm/versions/node/v16.13.2/bin/node',
'.../a.ts',
'--test=1232323'
]

$1 are removed

when i run it like

npx ts-node a.ts --test='abc$abc$abc'

the output is

[
'.../.nvm/versions/node/v16.13.2/bin/node',
'.../a.ts',
'--test=abc'
]

Expected Behavior

The first output should be

[
'.../.nvm/versions/node/v16.13.2/bin/node',
'.../a.ts',
'--test=123$123$123'
]

the second

[
'.../.nvm/versions/node/v16.13.2/bin/node',
'.../a.ts',
'--test=abc$abc$abc'
]

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm:8.11.0
  • Node.js:16.12.2
  • OS Name:MAC OSX
  • System Model Name: MAC BOOK PRO
  • npm config:
; "user" config from /Users/sebastian.mahr/.npmrc 
always-auth = true 

; "project" config from /Users/sebastian.mahr/.../.npmrc


registry = "https://registry.npmjs.org/" 

; node bin location = /Users/sebastian.mahr/.nvm/versions/node/v16.13.2/bin/node
; node version = v16.13.2
; npm local prefix = /Users/sebastian.mahr/...
; npm version = 8.11.0
; cwd = /Users/sebastian.mahr/Code/Sovanta/...
; HOME = /Users/sebastian.mahr
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions