My understanding of npm update is that it will only update modules if that module is not installed or is not on the latest version. As part of our build process we run a npm update to make sure we have the latest modules, but it runs a GET on every single package whether or not it needs to be updated. Does npm update really pull down the modules even if it does not need to update them?
npm update
npm http GET https://registry.npmjs.org/grunt/latest
npm http GET https://registry.npmjs.org/grunt-contrib-copy/latest
npm http GET https://registry.npmjs.org/grunt-contrib-concat/latest
npm http GET https://registry.npmjs.org/grunt-contrib-coffee/latest
npm http GET https://registry.npmjs.org/grunt-contrib-jst/latest
...
My guess that it only fetches information about packages and update them only if it found newer
Does npm update really pull down the modules even if it does not need to update them?
No, it doesn't. The GET
requests only return a json
object, with information about that particular module. npm
does it in order to check if the locally installed version needs to be updated. If the local module is outdated, npm
downloads it.
npm update -g some_module
This silently does nothing if you have not previously installed some_module