yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.72k forks source link

Yarn install fails with no output in workspaces project #8603

Open ccourtney3 opened 3 years ago

ccourtney3 commented 3 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior?

Attempting to run yarn install in a large workspaces project gets about 75% through linking dependencies and then fails silently. On subsequent tries it fails almost immediately after starting linking dependencies. Even with --verbose there is no error or any indication of why it stops.

I've tried removing the node modules, and yarn lock and retrying it, as well as removing and re installing the entire repo. This happens on multiple node and yarn versions. I've also tried increasing the network timeout and setting the child concurrency to 1.

Installing the same packages in a non workspaces project works, as does running yarn install on an empty workspaces project. It seems to be some combination of the packages and workspaces, but can't figure out anything past that. Any suggestions would be appreciated

What is the expected behavior? yarn install finishes without issue, or throws an error which describes what went wrong

Please mention your node.js, yarn and operating system version.

Node: 14.15.0 - also tried 12.13.0, 11.13.0, 10.16.3 Yarn: 1.22.5 OS: Windows 10

andranikarakelyan commented 3 years ago

Almost the same in our project ( in Typescript ) Problem "Module not found" error message not showing, when we try to use W2 workspace module in W1 workspace module, but not added W2 module to list of dependencies in W1 module package.json. Instead of messages yarn logs blank lines Workaround Install whole workspace with --verbose flag yarn install --verbose In this case error message about Cannot find module '-----' or its corresponding type declarations. is showing before exit with stack

@ccourtney3, maybe you have circular dependency in your workspace ?

ccourtney3 commented 3 years ago

Even with --verbose there are no errors showing, just the normal logs. Others pulling the same repo have been able to install the packages without issue.

I was able to narrow it down by removing packages one by one. It seems to be caused by the existence of react-scripts from create react app in one of the workspaces. Removing that package allows the full workspaces to run install without issue. Similarly taking the specific workspace that uses create react app and running as a normal yarn project outside of workspaces allows the install to work fine. So it seems to be some sort of interaction between create react app and yarn workspaces install.

However, I still have not been able to get them to work together