After I upgraded to latest stable node
and npm
, I tried npm install moment --save
. It saves the entry in the package.json
Related to this question you can review Composer documentation on versions, but here in short:
So, with Tilde you will get automatic updates of patches but minor and major versions will not be updated. However, if you use Caret you will get patches and minor versions, but you will not get major (breaking changes) versions.
Tilde Version is considered "safer" approach, but if you are using reliable dependencies (well-maintained libraries) you should not have any problems with Caret Version (because minor changes should not be breaking changes.
You should probably review this stackoverflow post about differences between composer install and composer update.