npx icon indicating copy to clipboard operation
npx copied to clipboard

Conform to NPM behavior when dealing with paths that include `path.delimiter`

Open Xunnamius opened this issue 5 years ago • 0 comments

The problem is illustrated succinctly below:

2018-09-14

Essentially, both Linux and Windows allow for path.delimiter to appear in directory names. NPM handles this gracefully in all cases that I've encountered, but the latest NPX chokes.

A little background on why I have to put a colon in my directory name:

I develop on Windows (VS Code) but the vast majority of my source lives on my Linux box. I do a lot of debugging using Chrome's DevTools and Node's inspector. Due to VS Code's strange path mapping and lax/outdated documentation, I just decided to replicate the Windows path—including the "root" colon—on Linux so everything would Just Work (tm). And now everything does work! ... except now NPX doesn't work. After some digging, it turned out that it was because NPX prepends npm bin to process.env.PATH, even if the prepended path has the OS's path.delimiter in it.

NPM handles this gracefully AFAIK. I believe NPX should parallel NPM in this regard.

Xunnamius avatar Sep 16 '18 03:09 Xunnamius