Stop “npm install” in Heroku

I have a node.js project that I want to run on Heroku, but with my own modified node plugins in the node_modules folder. When deploying the project to Heroku, it keeps installing brand new node dependencies, which overwrites my modified ones.

According to this Stack Overflow answer, “npm install” always runs and cannot be blocked or skipped. However, there is one workaround, which is to create a .npmrc file in the project root with the following contents: dry-run

The dry-run setting tells npm that we do not want to make any changes to the node_modules folder, thus keeping our node plugins unaffected!