Skip to content
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

Unexpected interaction between --lockfile-only with --frozen-lockfile modifies the lockfile. #6962

Open
3 of 4 tasks
Zemnmez opened this issue Aug 19, 2023 · 4 comments
Open
3 of 4 tasks

Comments

@Zemnmez
Copy link

Zemnmez commented Aug 19, 2023

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.7.0

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

npm exec pnpm@8.7.0 --yes i --frozen-lockfile --lockfile-only --dir .

Describe the Bug

This should have been fixed as per #6913
I note that ecad8a7 shows the commit as having landed in https://github.com/pnpm/pnpm/releases/tag/v8.7.0-0 and https://github.com/pnpm/pnpm/releases/tag/v8.6.12

I note that functionality is broken anytime --dir is provided (previously, I thought it was broken at a specific version.

At these versions, PNPM should be checking the lockfile and throwing an error if it's out of sync with package.json. However, it is simply updating the lockfile.

Expected Behavior

PNPM checks the lockfile is in sync with package.json, but does not update it or node_modules. PNPM returns a failure code.

Which Node.js version are you using?

v20.5.1

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Ubuntu

@Zemnmez
Copy link
Author

Zemnmez commented Aug 19, 2023

@zkochan

Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 19, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 19, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 19, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 19, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 19, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
@Zemnmez
Copy link
Author

Zemnmez commented Aug 20, 2023

sorry about all the noise sapling is generating on this issue.

@Zemnmez
Copy link
Author

Zemnmez commented Aug 20, 2023

Okay, I've confirmed that this works correctly ONLY when --dir is not provided.

Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
@Zemnmez
Copy link
Author

Zemnmez commented Aug 20, 2023

tshadwell@Thomass-Air monorepo-sl % npm exec --yes pnpm@8.6.12 i --frozen-lockfile --lockfile-only
 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json

Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

8.6.12 working as intended without --dir.

tshadwell@Thomass-Air monorepo-sl % npm exec --yes pnpm@8.6.12 i --frozen-lockfile --lockfile-only --dir .
 WARN  `node_modules` is present. Lockfile only installation will make it out-of-date
 WARN  deprecated @bazel/typescript@5.8.1: No longer maintained, https://github.com/aspect-build/rules_ts is the recommended replacement
 WARN  deprecated @types/sharp@0.32.0: This is a stub types definition. sharp provides its own type definitions, so you do not need this installed.
 WARN  deprecated @types/svgo@3.0.0: This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.
Progress: resolved 86, reused 85, downloaded 0

8.6.12 failing with --dir.

tshadwell@Thomass-Air monorepo-sl % npm exec --yes pnpm@latest i --frozen-lockfile --lockfile-only --dir .
 WARN  `node_modules` is present. Lockfile only installation will make it out-of-date
 WARN  deprecated @bazel/typescript@5.8.1: No longer maintained, https://github.com/aspect-build/rules_ts is the recommended replacement
 WARN  deprecated @types/sharp@0.32.0: This is a stub types definition. sharp provides its own type definitions, so you do not need this installed.
 WARN  deprecated @types/svgo@3.0.0: This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.
 WARN  deprecated @pulumi/command@4.5.0: Inadvertently published.
Progress: resolved 98, reused 98, downloaded 0

Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant