You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pnpm patch <name> requires node_modules/.modules.yaml to be present #8257
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_modules is 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.yaml does exist, node_modules may or may not (the deciding factor is node_modules/.modules.yaml).
Patching relies on node_modules. This is an easy requirement to meet (just run pnpm 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)
changed the title [-]`pnpm patch <name>` requires `node_modules` to be present[/-][+]`pnpm patch <name>` requires `node_modules/.modules.yaml` to be present[/+]on Jun 28, 2024
Activity
[-]`pnpm patch <name>` requires `node_modules` to be present[/-][+]`pnpm patch <name>` requires `node_modules/.modules.yaml` to be present[/+]fix(patch): error message for missing .modules.yaml
KSXGitHub commentedon Jul 16, 2024
I am not sure if
pnpm patchshould also install dependencies. What do you think, @zkochan?fix(patch): error message for missing .modules.yaml (#8315)
chore(deps): update pnpm to v9.7.1
chore(deps): update pnpm to v9.7.1
chore(deps): update pnpm to v9.7.1
chore(deps): update pnpm to v9.7.1
chore(deps): update pnpm to v9.7.1