Will npm always install the latest available version from the specified range?

Viewed 131

Consider I have a package that has lodash as a dependency which is specified using the following semver range: ^3.9.1:

enter image description here

1). Will npm always install the latest available version that is satisfied by the specified version range (i.e. 3.10.1), or is there a chance (some edge cases) that some other version would be installed from this range, e.g. 3.9.3?

2). If answer to the previous question is yes, then why would npm specify dependencies using caret and three version numbers (e.g. ^3.9.1) and not like ^3 or 3.x, what purpose does specific minimal version serve?

0 Answers
Related