After I upgraded to the latest stable
npm, I tried
npm install moment --save. It saves the entry in the
package.json with the caret
^ prefix. Previously, it was a tilde
~version Approximately equivalent to version, will update you to all future patch versions, without incrementing the minor version.
~1.2.3 will use releases from 1.2.3 to <1.3.0.
^version Compatible with version, will update you to all future minor/patch versions, without incrementing the major version.
^2.3.4 will use releases from 2.3.4 to <3.0.0.
See Comments below for exceptions, in particular for pre-one versions, such as ^0.2.3
~. Set this if you want to have tight control over your versions:
npm config set save-prefix=''— Jul 08, 2015 at 06:11
major version. That's why docs.npmjs.com used the specific words:
the left-most non-zero digit. Also what about this case: ^0.0.4 means 0.0.4 — Oct 12, 2015 at 10:14
Ain 3 versions:
0.0.3. There is a bug in
0.0.1so you want to have at least
0.0.2in your package
B. If you write
0.0.3, which is OK. But if some other package
Aand additionally has constrain
"A": "<0.0.2"you'll get
0.0.1without showing any conflict issue, which is not what you want. Using tilde
~0.0.2should help you avoid this issue. — Oct 22, 2015 at 14:22
External links referenced by this document:
Local articles referenced by this article: