I have a Node.js app with npm-shrinkwrap.json checked in. When I run npm install locally, it installs the versions specified in npm-shrinkwrap.json, but when I push it to Heroku (on the Cedar stack), it seems to ignore the shrinkwrap and simply installs the newest version.
Am I doing something wrong? I don’t need to to check in node_modules, do I?
As you say in your answer, when Heroku wrote the Nodejs buildpack, the feature
npm shrinkwrapdidn’t exist.However, as of version 1.1.2,
npm installtriesnpm-shrinkwrap.jsonfirst, falling back topackage.json. This means that Heroku respects it (even though the feature hadn’t been conceived when Heroku wrote their code). Isaacs is awesome.So just add to your
package.json:Then run
npm shrinkwrap, andgit add npm-shrinkwrap.json. Then commit as normal.