Disabling NPM 5’s new package lock file
Jul 10, 2017 · 1 min read
NPM 5 is out and it has numerous improvements over previous versions. It’s faster and now includes a package-lock.json file by default. That means everyone will use the same locked version of every dependency. That’s great!
However, if you’ve been using Facebooks Yarn package manager and want to continue using it. You probably don’t want to have it’s yarn.lock file alongside the NPM package-lock.json file. In fact if you’re doing a Node project on Heroku and it sees both files, it won’t let you deploy.
So, how do we disable the NPM 5 package-lock.json file? It’s simple.
- Create a
.npmrcfile in your project directory if you don’t already have it. - Add
package-lock=false
That’s it!

