question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pnpm lock file update

See original GitHub issue

Affected Packages

Not sure.

Problem

When using pnpm with changesets in a monorepo, after merging the “Update Versions” PR from the changesets action, CI breaks on the “Install” step since changesets has updated the versions in linked packages but has not updated the pnpm-lock.yaml.

Proposed solution

I think after changesets updates linked package versions to the new/upcoming version, it should run pnpm install -r (recursive) to update the lock file. Not sure if there is a better solution or how pnpm itself is handling this issue. Thoughts @zkochan ?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
equinusociocommented, Feb 4, 2022

On our side, we ended up using a custom sh script as temp fix:

- name: Create Release Pull Request or Publish to NPM
  id: changesets
  uses: changesets/action@v1
  with:
    version: ./update-lock.sh
    publish: npm run release
npx changeset version
npm i --package-lock-only
7reactions
jedrichardscommented, Sep 3, 2021

Just making a note regarding Yarn Berry behaviour, maybe of interest or help with Googling this issue for others … commonly on CI we run yarn install --immutable but this will fail on the Version Packages PR since that has amended the dependency versions without updating the lockfile and outputs the following failure:

The lockfile would have been modified by this install, which is explicitly forbidden.
Read more comments on GitHub >

github_iconTop Results From Across the Web

pnpm install
pnpm install is used to install all dependencies for a project. In a CI environment, installation fails if a lockfile is present but...
Read more >
pnpm install doesn't refresh lock file · Issue #2807 - GitHub
Run pnpm i Scope: all 2 workspace projects Lockfile is up-to-date, resolution step is skipped ERROR Cannot install with "frozen-lockfile" ...
Read more >
@pnpm/lockfile-file - npm
Start using @pnpm/lockfile-file in your project by running `npm i @pnpm/lockfile-file`. There are 30 other projects in the npm registry ...
Read more >
npm - How to have `pnpm install` install everything exactly to ...
Running pnpm install --frozen-lockfile will work again, but not update the installed version.
Read more >
Migrating to rules_js - Aspect's Bazel Documentation
rules_js uses the pnpm lockfile to declare dependency versions as well as a deterministic layout for the node_modules tree.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found