NPM audit fix for "tmp" package #174594
-
Select Topic AreaQuestion BodyGiven the following package.json:
Why does NPM not install v0.2.5 of "tmp" which has a low severity vulnerability fix when running "Previously Undocumented Breaking Changes" https://www.npmjs.com/package/tmp/v/0.2.5?activeTab=versions If I update the package,json to Thanks, |
Beta Was this translation helpful? Give feedback.
The behavior you’re seeing isn’t a bug with
npm audit fix
itself but rather how thetmp
package versions have been published.A few key points:
Your declared range (
^0.0.33
)With semver, anything before
1.0.0
is special:^0.0.x
only allows patch updates (it won’t jump to 0.1.0).^0.x.y
allows updates within that minor version, but not across minors.So
^0.0.33
means: “≥0.0.33 and <0.1.0.” That range can never reach0.2.x
.Why
npm audit fix
doesn’t install 0.2.5npm audit fix
won’t go outside your declared version range unless you explicitly pass--force
.package.json
pins^0.0.33
, it will stick to the 0.0.x line.Why
^0.2.0
stops at 0.2.4