Do npm caching based on npm-shrinkwrap.canonical.json

Fixes #12261.