-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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.lock not generated correctly with yarn v4 #19881
Comments
This is likely to be the same as #17873 that was fixed #18192 but introduced #18726. This last one was fixed by #18759 but brought back the same issue. Long story short, it is not a new issue, just an edge case for the people using To reproduce it i'm sure we can take any of the example repos in those issues. |
We are experiencing the same problem with the same configuration. I can confirm that re-applying the diff from #18192 does indeed fix the problem. |
I have same problem and this is minimum repro code. execute ...
"":
version: 2.3.2
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#optional!builtin<compat/fsevents>::version=2.3.2&hash=df0bf1"
dependencies:
node-gyp: "npm:latest"
conditions: os=darwin
languageName: node
linkType: hard
... |
@veimox @meeroslav Since this bug was reintroduced with the recent changes, are there any plans to get this fixed? It would be great to have compatibility with yarn v3 / v4. Thanks for your work! |
We're also experiencing this issue with latest versions of nx and yarn - any updates? |
Same issue running nx 18.2 and yarn 4.1.1. For one of our services I need to revert to yarn 1 to install the dependencies. I did some additional tests in our specific bundle and I traced the culprit down to a specific const Converter = require("api-spec-converter"); Removing that line fixes the generated yarn.lock. Creating a nx nest project with only one single |
Is this still on the NX team's radar? Yarn berry is widely adopted these days, and not having the ability to easily prune node_modules using yarn for a single service/app/etc. breaks the single package.json philosophy. My team currently has to workaround this by ignoring the generated yarn.lock and reinstalling packages using the generated package.json which is really not ideal. |
I second @z0w0 's statement. Our team just had to do the same thing to make this work. |
Thirding @z0w0. This has become a big pain for our team. |
@z0w0 As a potential improvement you could also take out the incorrectly generated parts from the yarn.lock file. E.g. in our case I just added a simple command to our Dockerfile:
This would take out those incorrect lines and still install everything else according to the lock file, not ideal of course, but better than just installing everything from the package.json file. This won't work with |
This will work you just have to find the correct lines in your yarn.lock file. For me it was `RUN sed -i '8.19d' yarn.lock Where 8 and 19 are the starting and ending lines of thigs you want to delete |
Probably a cleaner solution until someone on the nx team gets this fixed is to do this. It's what I ultimately did
|
Hi @DrewLandgraveCbsi , We are experiencing the same issue, could you briefly explain your solution with corepack please? How is it different than doing clean install based on package.json ? Thanks a lot |
@bieblebrox Corepack is required for yarn berry (we're on yarn 4.x) which we are using. If you aren't then you done need it. But ultimately removing the yarn.lock and doing install is doing a fresh install from the package.json Copying the yarnrc.yml and the .yarn folder were required because GitHub kept complaining without them. |
+1 |
We are in the same situation. We would appreciate an immediate fix to this. |
+1 |
Having the same issue on a project of ours, only workarounds have been to revert to using yarn 1.x or install from |
@FrozenPandaz @MaxKless - submitted a proposed fix in the above PR if you could take a look. This one is a bit over a year old now. |
sorry I missed this @a88zach but thank you so much for the PR! |
For anyone following, there is one more issue. This code needs to be updated for v4: https://github.com/a88zach/nx/blob/master/packages/nx/src/plugins/js/lock-file/yarn-parser.ts#L601 In v3 the dependencies are listed with jus the semvar: Looking for a fix and will hopefully have another PR soon |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
When using Yarn v4 and executing a build using @nx/webpack with
"generateLockfile": true
, the generated yarn.lock file is not generated correctly.The first item in the yarn.lock file is generated without a name as seen below
However, this is the corresponding entry from the root yarn.lock file
As a result,
yarn install
will fail with the following errorExpected Behavior
The yarn.lock file should include the name of the matching entry from the root yarn.lock so that
yarn install
runs correctlyGitHub Repo
No response
Steps to Reproduce
"generateLockfile": true
yarn install
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: