“express” : “1.2.3” – NPM will grab this specific version only.
•
“express”: “~1.2.3” – NPM will grab the most recent patch version.
(So, ~1.2.3 will find the latest 1.2.x version but not 1.3.x or anything
below 1.2.x.)
•
“express”: “^1.2.3” – NPM will grab the most recent minor version.
(So, ^1.2.3 will find the latest 1.x.x version but not 1.3.x or anything
below 1.x.x.)
•
“express”: “*” – NPM will grab the newest version available. (There is
also an explicit latest value that does the same thing.)
There’s quite a lot more to SemVer than this (and there’s also no shortage of criticism
and folks who aren’t exactly fans of it), but this should cover the most common features
you’re likely to encounter. Indeed, this should be all you will need for this book.
Note When using the npm install
command, you can add
@major.minor.patch after the package name to specify the version to install
using all the Semver rules described in the preceding text.
Do'stlaringiz bilan baham: |