Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

[BUG] Quotes not respected #43

Open
hdimitrov1 opened this issue Mar 7, 2020 · 1 comment
Open

[BUG] Quotes not respected #43

hdimitrov1 opened this issue Mar 7, 2020 · 1 comment

Comments

@hdimitrov1
Copy link

hdimitrov1 commented Mar 7, 2020

What / Why

npx does not respect quotes around spaces in arguments list when running on an already-installed package.

When

When executing npx onto a pre-existing package.

Node version is 10.19.0

Npx version is 6.13.4

Where

CLI?

How

Current Behavior

Output of command below is:

[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\Users\\buhala\\Desktop\\test123\\node_modules\\print-process-argv\\index.js',
  'hello',
  'world' ]

Steps to Reproduce

mkdir test123
cd test123
npm init -y
npm i --save print-process-argv
npx print-process-argv "hello world"

Expected Behavior

[ 'C:\\Program Files\\nodejs\\node.exe',
  'C:\\Users\\buhala\\Desktop\\test123\\node_modules\\print-process-argv\\index.js',
  'hello world' ]

This doesn't happen when the package is not installed. So far this bug is Windows-only.

@genechk
Copy link

genechk commented Oct 17, 2020

I’ve found a bizarre workaround.
Apparently, you can escape spaces with this combination:

"hello\`" world"

It doesn’t work for npx print-process-argv but works for other npx scripts that I’ve tried. No idea why, though.
Update: after I’ve installed print-process-argv it worked on it too.

Node version: 14.11.0
Npx version: 6.14.8
Windows 10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants