-
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 link
doesn't globally symlink bin executable of local project
#1585
Comments
the same problem (Yarn 0.17.9, Windows 7, Node 6.8.1, Gulp 3.9.1) |
In my case:
I tried It did install it to But it seems to have failed to add a symlink to |
…al bin directory, as if it were `yarn global add`’ed. Fixes yarnpkg#1585
* Makes `yarn link` link the target package’s `bin` entries to the global bin directory, as if it were `yarn global add`’ed. Fixes #1585 * Add error handling if bin link destination already exists * Run bin unlink before we unlink the whole package * Updating error message
This does not work on Windows where .cmd files are created in the bin directory for all the binaries - it is not enough to just symlink. |
How is this a bug? Surely a local yarn install shouldn't put anything in a global area. |
This caught me out too. To clarify, this is the behaviour of npm:
|
@MikeTaylor Perhaps you're misunderstanding what the point of |
Could be. We abandoned |
(Not just in this respect, I mean. All sorts of pervasive problems.) |
Do you use a different mechanism for working on command line tools? |
We've found workspaces get us closer to where we want to be. Beyond that we're also using a tool of our own that builds and runs the specific large system we're working on. It's a real shame that Yarn, which we all thought was going to fix everything we hated about NPM, ended up introducing other stuff that also doesn't work, but in different ways. Still, I do recommend workspaces. |
Is there a way to get this working with |
I have a fix: #7543 |
@jetpack I have the exact same issue with yarn 1.21.1. Is there a bug report for this issue somewhere here? |
@jetpack nevermind. I found the explanation in the last paragraph under Path Setup.
|
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Running
yarn link
in a local project with abin
-script specified inpackage.json
doesn't put a symlink to the script in the global bin directory (yarn global bin
).If the current behavior is a bug, please provide the steps to reproduce.
In a project folder with the following files:
package.json
index.js
run
yarn link
.What is the expected behavior?
The foo command should be available in the PATH,
foo #=> bar baz
and a
foo
symlink should be present in theyarn global bin
directoryPlease mention your node.js, yarn and operating system version.
MacOS Sierra, Version 10.12
Node v5.4.0
Yarn 0.16.1
The text was updated successfully, but these errors were encountered: