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
CI complains of outdated lockfile but says the lockfile is up to date #5144
Comments
can you create repository that reproduces the issue? |
I'll try to make a repro of this, because this is happening in our monorepo at work. |
I'm finding a the same issue which i also fixed by downgrading to 7.5.2, it seems that Pnpm wants to generate a different lockfile on Macos vs Linux? Unfortunately this is also happening on my work monorepo so can't share a repro either. |
Do you use the |
Exactly, we have this setting enabled at the moment. I'll be able to try on Tuesday with the option set to false instead to see if it makes a difference |
Same error here when trying to upgrade to pnpm 7.9.0 with auto-install-peers being true. 7.5.2 works without problems. |
Have you tried to remove your lockfile and node_modules, then to generate again and commit it? The issue is that pnpm now installs the root peer dependency automatically, so if you did not have the peer dependency in your package.json, your lockfile will now be considered outdated. |
Unfortunately this doesn't fix the issue. The only way to fix it seems to be by removing |
@zkochan removing lockfile and node_modules did not work. What helps is moving a peer dependency from
and pnpm at version 7.9.2 |
@tleunen same here, once I set |
Failure appears to happen when the peer dependency is a devDependency in root or any other workspace.
Here is a minimalish set of files:
pnpm-workspaces.yaml:
packages\api-extractor-configuration\package.json:
I attempted workaround of making the few peers we have be regular dependencies in the root, but the issue remained so long as any other package had the peer as a devDependency. |
I'm also experiencing this problem - unfortunately it's a massive project so we can't just move dependencies around until everything lines up nicely. Looking forward to seeing a resolution to this issue. |
For one repository I went ahead and added all of the peer dependencies explicitly. For another that we are upgrading from pnpm 6 to 7, we will be setting |
@jason-ha thanks I was able to reproduce it https://github.com/zkochan/pnpm-issue-5144 |
* fix: auto installing peer dep in a workspace close #5144 * fix: auto installing peer dep in a workspace * fix: auto installing peer dep in a workspace
@zkochan I see you've closed this - is there a resolution to this? |
Soon in v7.11.0 |
Amazing - really appreciate it. I know it's probably difficult to say, but do you have an idea of when that will be published? Are we talking days/weeks/months? I'm assuming pretty soon 😄 |
Soon means like 5 minutes |
Hahaha you're a legend! |
I'm still receiving this issue on 7.11.0 but I'm not 100% sure how I'm going to be able to reproduce this for you as it's happening in a work project repository and it's pretty big. |
Have you removed node_modules and |
I just love the fact that it installs peers and transitive peer dependencies as well. Yarn 1 was my go to pm, but for years they've been adamantly refusing to work on this seemingly intuitive feature. I had to use other means to auto install peers for years hoping they'd fix this. I ditched it coz yarn 2+ is actually removing more features or making it harder to use, meaning we have to use other workarounds. EG, Try yarn link in v1, works well, but not in yarn 3, I don't even know how to do it in yarn 3, it was just frustrating that I had to just leave it, yet linking is supposed to be so simple. PNPM is fast and does everything in a much much better and intuitive way, and seem to be more supportive of how people use PM's; @zkochan and team listen to feedback and they actually made this with regards to how people use package managers not how they want people to use package managers. Thanks a million, we will support your efforts. |
After I update pnpm to |
@emahuni you had to only remove the lockfile and node_modules. The reason you need to remove node_modules is because there is a duplicate of the lockfile inside |
yes, that's right, but that didn't work. The reason why I had to remove it is a long story, but it worked at the end. I was having that issue, tried what you are saying and more (deleting all lock files, .pnp, node_modules, and everything as if I am using pnpm for the first time - I actually had to write a script to do this since i did this many many times in trial and error mode trying to see where I was hitting a wall, coz it initially worked). So I ended up:
However, this is now my package manager of choice coz it's just super super duper badass! Though I feel there are still a few edge cases to fix, the whole concept is going in the correct direction. cough support for something like yarn publish on v1 is needed pliz cough 😬 |
Oh yah one thing I forgot to mention is that when I came back to pnpm, I had moved the .npmrc file into a bck dir when I ditched pnpm, so I was starting afresh. you see that?
that was me trying to fix the issues before ditching pnpm, then this:
is now, working without any issues when I came back to pnpm. believe me, I had that config before and it didn't work, it wasn't about this config. |
I think the original issue was fixed. If you have exact steps to reproduce, open a new issue. |
@zkochan Is there any verbose mode or anything that could help finding the root cause? I'm having hard time reproducing it in a smaller testcase than what I have at work. But I might have found out that the lockfile is not generated/updated when I turn |
Are you by any chance using workspaces at work? |
Maybe you have this issue: #5372 (comment) |
I am still hitting this issue in |
I'm hitting with 7.17.0 and have followed all the processes but the workflow is still failing |
I'm getting this error as well. which... makes sense.. most of these deps don't have bins. This is how I tested, and made C.I. show me what is wrong: pnpm install --fix-lockfile
git_diff=$(git diff) # this prints the git diff as well as stores it in a variable
if [[ "$git_diff" -eq "" ]]; then
echo "Success: no lockfile differences" ;
else
echo "Error: lockfile differences detected";
fi |
Hi! Can anyone please help me with this issue I have tried all the steps recommended by the community above. Waiting for response! |
@zkochan This issue appears on v8 as well.. I tested with 8.5 and 8.6 |
I had the same problem, but then I realized that there was an outdated |
Here's what worked for me: pnpm i --fix-lockfile --config.auto-install-peers=false Run this locally, then commit your updated lockfile. |
The CLI says the lockfile is up to date but it still failing when it runs on CI. Running
pnpm i
locally doesn't create any updates to the lockfile.pnpm version: 7.8.0
The issue exists since the release of 7.6.0. It works fine in 7.5.2
Expected behavior:
CI doesn't complain about outdated file when the lockfile is updated.
Actual behavior:
CI complains the lockfile is outdated
Additional information:
node -v
prints: 16.16.0The text was updated successfully, but these errors were encountered: