npm/npx

[BUG] `npx` doesn't preserve whitespace in arguments on Windows

Closed this issue · 5 comments

rivy commented

npx is not preserving arguments with internal white space correctly on Windows; it separates the arguments for the resulting executable. For example ...

$ # *nix
$ node -e "console.log(process.argv.slice(1))" "test this"
[ 'test this' ]
$ npx node -e "console.log(process.argv.slice(1))" "test this"
[ 'test this' ]
C:> rem Windows
C:> node -e "console.log(process.argv.slice(1))" "test this"
[ 'test this' ]
C:> npx node -e "console.log(process.argv.slice(1))" "test this"
[ 'test', 'this' ]
rivy commented

Ping! Knock, Knock! Anyone home?!?

This is the place that is suggested in the documentation for problem reports and resolution, but I don't see anyone even answering any of the issues ... Is there somewhere else to report the problem?

This bug can be quite annoying. At the https://github.com/deltachat/deltachat-node project we use node-gyp-build as a guard on the npm install step to check if prebuilds are present or not. If they are not present, it executes the first argument as a shell command.
The npm install step looks like this: "install": "npx node-gyp-build \"node scripts/install.js\"".

What happens is that npx doesn't preserve the arguments and node-gyp-build invokes just node when no prebuild is present instead of invoking node "scripts/install.js".

rivy commented

After the repository was "transferred" from @zkat, back in mid-2019, it looks like there is no love lost on this project. Even simple questions such as "(How) Is this maintained?" go completely unanswered.

I'm planning on closing this off of my issue list in the near future if the lack of response continues.

Maybe a yarn based solution would be a better way to go?

I just saw ynpx. 🤞

The issue still seems to exist, right @Jikstra ?
So it might make more sense for @rivy to reopen it (and unsubscribe from notifications if you are no longer interested in updates).

Just my 2 cents

This issue has been submitted again in #43.