After I upgraded to latest stable node
and npm
, I tried npm install moment --save
. It saves the entry in the package.json
~
fixes major and minor numbers. It is used when you're ready to accept bug-fixes in your dependency, but don't want any potentially incompatible changes.
^
fixes the major number only. It is used when you're closely watching your dependencies and are ready to quickly change your code if minor release will be incompatible.
In addition to that, ^
is not supported by old npm versions, and should be used with caution.
So, ^
is a good default, but it's not perfect. I suggest to carefully pick and configure the semver operator that is most useful to you.