Verify latest release
pnpm version
No response
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/anttis/repros/tree/main/pnpm-audit-fix-save-prefix
Reproduction steps
- With a project with a vulnerable dependency, set a
savePrefix: '' setting into the pnpm-workspace.yaml config.
- Run
pnpm install
- Run
pnpm audit --fix override
- Observe that caret version ranges are used in the overrides.
Describe the Bug
pnpm audit --fix override uses caret version ranges regardless of the version range (savePrefix) that the user has configured.
(...And this will most likely lead to situations where e.g. Renovate will do a PR that will strip the caret if it's configured to use pinned versions)
Expected Behavior
The overrides should use the same prefix that the user has configured or support a --save-exact kind of option.
Which Node.js version are you using?
v24.15.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
Verify latest release
pnpm version
No response
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/anttis/repros/tree/main/pnpm-audit-fix-save-prefix
Reproduction steps
savePrefix: ''setting into the pnpm-workspace.yaml config.pnpm installpnpm audit --fix overrideDescribe the Bug
pnpm audit --fix overrideuses caret version ranges regardless of the version range (savePrefix) that the user has configured.(...And this will most likely lead to situations where e.g. Renovate will do a PR that will strip the caret if it's configured to use pinned versions)
Expected Behavior
The overrides should use the same prefix that the user has configured or support a
--save-exactkind of option.Which Node.js version are you using?
v24.15.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response