I've updated npm to it's latest version recently to get the performance upgrade. But since my company hasn't updated globally, I don't want the usage of package-lock.json.
I could simply ignore it in git workflow by adding package-lock.json to my .git/info/exclude. But it would still be used by npm when installing or updating dependencies.
So how can I tell npm not to use it?
To disable package-lock.json in a project you can add
.npmrc file and content of this file will be
package-lock=false
if you try to install with npm the file will not generate.
package-lock.json usage globallyTo disable it globally, you'll have to set your package-lock to false in your ~/.npmrc. You can do it by using:
npm config set package-lock false
This will allow you to use npm@5 performance without bothering with package-lock.json. Though package-lock.json has many benefits according to npm doc, and you may consider using it.
package-lock.json usage per commandAccording to npm-cli doc, you can use --no-package-lock options for the install command:
npm install --no-package-lock any-lib
And according to this question, existing package-lock.json will not be taken care of.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With