Disabling NPM 5’s new package lock file

Riaz Virani
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.

  1. Create a .npmrc file in your project directory if you don’t already have it.
  2. Add package-lock=false

That’s it!

hexient-labs

Tiny thoughts from the team at Hexient Labs

Riaz Virani

Written by

hexient-labs

Tiny thoughts from the team at Hexient Labs

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade