-
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 does not install package dependencies #2914
Comments
Waiting on this here OrKoN/npm-link-shared#10 |
Ah, sorry, expected behavior is that With Note: |
Another addition to this: I have actually found the current behavior to be better than npm's behavior! My use case: Using docker volumes to mount dependencies so that I can npm link them during development. The npm link call inside the docker container will error out, because npm does not have write access to the outside folder (and I would prefer not to If you do add implement this to reach feature parity with npm, I would love a method to opt out of this time consuming and, for me, environment breaking behavior, e.g. with a flag like |
using |
The only way yarn link is actually useful is if it installs dependencies. Most packages have dependencies and if you're testing one package in another, you need those dependencies. |
@whitecolor I don't want to |
I would want yarn link to also install deps that are linked by the package I'm linking... IOW I might have multiple nested "links" that I want to all link to the working directory for that project. Is this possible? It doesn't seem to be the default behavior. |
Hi, any updates on this? |
My workaround so far has been to use a build script that does I would absolutely want |
Try yalc - made for this purpose. |
The way I was able to handle this is via |
I was quite surprised by this behavioural difference between Yarn and NPM. It affectively makes cross-module development using link difficult and confusing. If I link a package, I want its deps too. I can't really think of a scenario where you wouldn't. |
@whitecolor Thanks for the Yalc, I started using it and it works like a magic :) |
This issue just cost me a lot of time to figure out why a build in a project into which I had linked a dependent package with |
Still no plans to address this? |
I'm wondering: It seems like with workspaces yarn is able to handle symlinks and installing their dependencies as well: The actual packages are symlinked in But when I run a I tried to work around this by giving the package a version that was not published, but then |
I am trying to make some changes to some package. I link it to project where it used, and make changes to it's code and add some dependencies to make it work. But When I run Totally confused. Is there a way to work with dependencies of dependencies? |
This is the issue here, yarn seems to resolve the dependencies from it's cache. So if the library has already been published, it will take the published dependencies. We found a workaround for a monorepo setup:
After that, yarn will treat those dependencies just as packages in the monorepo, link them (again) in |
It’s what |
Yes, Yalc is what gave us the idea for the work-around. Yalc adds quite some work though, it's always necessary to publish after changing something because of the simulated registry – we didn't need that. |
Not need to If you want that all the dependencies of |
Closing as fixed in v2 where PnP and the |
yarnpkg/yarn#2914 will give some context
Bug.
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
The last
tree .
command should show thatlibrary
has anode_modules
directory withlodash
installed into it.npm
seems to run install on every linked package.Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: