[BUG] Colon in working directory break package resolution
Is there an existing issue for this?
- [X] I have searched the existing issues
This issue exists in the latest npm version
- [X] I am using the latest npm
Current Behavior
If I am in a directory that contains a : in the full name (e.g., /home/username/my:weird:folder):
npx {package}does not resolve{package}successfully, including if./node_modules/.bin/{package}exists and can be run explicitly as./node_modules/.bin/{script}.npm run {script}does not resolve{package}successfully if{script}is defined inpackage.jsonusing{package}, including if./node_modules/.bin/{package}exists and can be run explicitly as./node_modules/.bin/{script}.
Expected Behavior
I expect the resolutions in 1 and 2 above to work.
Steps To Reproduce
No response
Environment
No response
The bug is still present in 10.9.2. It took me embarrassingly long to figure out what the issue was 😅
Clearly this is not very high priority, since it's been 2 years since the first report, but I'll try to put together a patch to resolve the issue
The issue is that PATH on macos and linux uses colons as the deliminator. The way to make this work would be to alias the bin without a colon name in the path and add the alias to PATH. But I'm guessing the core maintainers would not be interested in that (it sounds like a pain to manage). Instead I'm going to add an error message (or maybe a warning might be better?) and call it a day