-
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
yarn run with bin in local node_modules #733
Comments
Thanks for the bug report! This is pretty important. I'll try to take a look tonight. |
Duplicate with more info here: #735 |
@notahat - That's actually a separate issue. This issue is saying that |
@Daniel15 I think it's the same thing. It's not that yarn isn't finding stuff in |
Ohh I see! That might be it. I'll take a look tonight 😄 |
@slmgc I don't see that when I try it.
BUT, if I do this:
That definitely isn't right, but I don't think it's the source of the problem as I'm seeing it. |
@slmgc I don't see that either. Both paths are identical |
Both look identical for me as well.
Though I am encountering this error (see issue 782). |
@notahat is correct #733 (comment). Running commands with no arguments works like |
As long as your command script has no arguments, it runs fine. With arguments it will fail to find the files. "scripts": {
"start": "node app.js",
"test": "./node_modules/.bin/mocha",
"bdd": "./node_modules/.bin/cucumberjs test"
},
If I remove the arguments for |
Hmm I'm having trouble replicating the issue on Windows.
Output:
I'll have to try it on Ubuntu again, once I figure out how to fix VirtualBox (or build a Docker image or something). It's no longer even opening on my desktop computer, and bluescreening when I start VMs on my work laptop 😕 |
This line looks like perhaps a culprit. https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/run.js#L64 |
I came across this issue as well, and I did a bit of digging. It looks like this line encases My test script is as follows:
In child.js:
Outputs:
Where it should be:
Removing the double quotes in run.js seems to make it work fine. |
It appears that npm doesn’t do the quoting e169535 introduced; seems like this feature should work the same as npm’s |
Sorry I didn't get a chance to look into this more fully tonight. It looks like @ticky submitted a PR though - Thanks! |
Yes, it's my mess. The only tested commands are currently "add", "install" and "self-update". I will add tests for "run" (and others if I have time) so this doesn't happen again. Thanks to @billxinli for reporting and @ticky for fixing it 👍 |
Fixed via #809. |
New release soon @kittens ? |
@mattieutu, the fix for this was released in 0.16.0, hope it hasn't regressed :( |
I don't know, but I can reproduce exactly the same problem now with the last version. With a I had to remove the node_modules folder and reinstall it with npm :-/ |
Same here with |
@mathieutu @dbpolito I suspect this is in fact an entirely separate issue where binstubs are not created for any dependency which isn’t top-level. Looks like #2758 might be your ticket? |
Yeah, it seems to be exactly that thing. |
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
From npm with respect to
npm run
:In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix.
If the current behavior is a bug, please provide the steps to reproduce.
Add additional entry to the
scripts
section of thepackage.json
without installing the dependency globally (in this case mocha).What is the expected behavior?
If I run
npm run test-api
it will resolvemocha
to the local copy. Howeveryarn run test-api
will produce:Please mention your node.js, yarn and operating system version.
node: 6.7.0
yarn: 0.15
os: Ubuntu 16.04
The text was updated successfully, but these errors were encountered: