-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
pnpm patch <name> requires node_modules/.modules.yaml to be present #8257
Copy link
Copy link
Closed
Labels
Description
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
9.4.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
- Ensure
node_modulesis not present - Attempt to patch a package (e.g.
pnpm patch typescript) - Observe failure
ERR_PNPM_PATCH_NO_LOCKFILE No pnpm-lock.yaml found: Cannot patch without a lockfile
Describe the Bug
There are 2 issues I see here.
- The error is misleading.
pnpm-lock.yamldoes exist,node_modulesmay or may not (the deciding factor isnode_modules/.modules.yaml). - Patching relies on
node_modules. This is an easy requirement to meet (just runpnpm i), it is inconvenient. Especially when pnpm has been relegated to the role of dependency resolver alone, like with build system integrations (in my case Bazel + Rules JS).
Expected Behavior
The patch workflow can run without needing node_modules.
Which Node.js version are you using?
20.14.0
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)
Linux (Dev Container running on Docker)
Reactions are currently unavailable