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 workspaces do not create correct symlinks when node_modules is symlinked as well #6977
Comments
Also,
|
I thought this might be a naming conflict between my workspace "api" and an external dependency named "api". Seems not to be case. I renamed that package to something unique, but now I see
|
This shouldn't really matter but FWIW my node_modules directory is symlinked somewhere else. |
Ok, well it seems as though yarn workspaces don't work when node_modules is symlinked, because the symlinks that it creates within node_modules are relative and therefore will not be pointing to the right things when node_modules is not in the root of the project directory. In other words, yarn makes assumptions about where node_modules actually lives that are not correct. Editing the issue to reflect this... My hacky workaround for the moment is to use --modules-folder. |
Where is this logic implemented? I can try taking a stab at it... |
I just deleted all of the node_modules folders and tried again... somehow it's magically working now. Very strange... I did however change the package names from "api", "cli" to "@myproj/api" and "@myproj/cli", etc. EDIT: I forgot I had |
Seeing this issue as well. |
Same for us for 1.22.0, it works fine for 1.6.0 |
This is so awful: Upgrading to yarn Downgrading to If this saves you some time I want some beer. |
I'm having the same issue. Yarn workspaces aren't creating symlinks correctly when used with Lerna, and my builds fail because dependencies among workspaces aren't resolved. Moreover, I can't install 1.9.2:
Trying a looser version gets the broken 1.22 release:
|
Looks like this was my mistake. I had references to my subpackages in
With those lines removed, Yarn appears to be linking packages as expected. |
downgrading from |
A similar issue here #8079 , and the author said don't make a symlink and close the issue. so it's a breaking change? |
If that directory (node_modules) is mapped by Google Drive, it use to create something like a simlink and that happens. Just move it to a directory that is not observed by any sync tool and it's sorted out. |
For anyone else stumbeling in here after trying to symlink the node_modules dir: I've worked around yarn not expanding links by using bind mounts. So I have something like this stucture:
But I want all these dirs to be in a shared path, lets say shared_modules, something like this:
(This is so that I can cache them in one go in my CI) So what worked is to do |
Do you want to request a feature or report a bug? bug
What is the current behavior?
I set up workspaces according to the docs here: https://yarnpkg.com/lang/en/docs/workspaces/. I have a root package.json (shown in yarn-error.log below) and package.json's in each of these subdirs. There are no dependencies between any of the workspaces. Here's what happens when I run
yarn install
in the root directory:And here's yarn-error.log:
If the current behavior is a bug, please provide the steps to reproduce. described above
What is the expected behavior?
yarn install
to work in workspacesPlease mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: