-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn against colons in directories when running user-defined scripts #7373
Comments
+1 to providing a warning as it's not at all clear to the user why the command doesn't work in this case |
I would say it would be better if |
This would be really nice to have! I just ran into this problem and I think it would save other people, mostly inexperienced yarn users, a lot of time. |
Do you want to request a feature or report a bug?
A feature (a warning)
What is the current behavior?
package.json:
Returns error:
some-command: command not found
This is because yarn appends the full path to
node_modules/.bin
to the$PATH
before running the script, in order forsome-command
to work. But in this case, the full path contains colons, which ends up breaking the system's parsing of the$PATH
. The system silently skips the invalid parts of $PATH andsome-command
cannot be found.What is the expected behavior?
First I looked up the way to escape a colon in $PATH, but it cannot be done.
So I suggest that yarn emits a warning before it attemps to run a user-defined script in a directory that contains colons. Such as:
Please mention your node.js, yarn and operating system version.
node 10.15.0, yarn 1.16, macOS 10.14.5
Related : #3515
The text was updated successfully, but these errors were encountered: