Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm notice created a lockfile as package-lock.json. You should commit this file

I have been trying to load the skeleton of express with npm install express. It outputs the following line:

npm notice created a lockfile as package-lock.json. You should commit this file.

What should I do in order to load the template ejs and css engine automatically?

like image 889
Venkateshreddy Pala Avatar asked Jun 03 '17 12:06

Venkateshreddy Pala


People also ask

Should package json lock be committed?

json intact. It is highly recommended you commit the generated package lock to source control: this will allow anyone else on your team, your deployments, your CI/continuous integration, and anyone else who runs npm install in your package source to get the exact same dependency tree that you were developing on.

What is npm package lock json?

package-lock. json is automatically generated for any operations where npm modifies either the node_modules tree, or package. json . It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.

Should npm lock files be committed?

A lock file contains important information about installed packages and it should always be committed into your Package Manager source repositories. Not committing the lock file to your source control results in installing two different modules from the same dependency definition.

How do I stop json from generating package lock?

Can I remove package lock JSON? delete both node-module and package-lock. json, then run npm install then npm start.


1 Answers

Yes. You should add this file to your version control system, i.e. You should commit it.

This file is intended to be committed into source repositories

You can read more about what it is/what it does here:

package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.

like image 80
zoecarver Avatar answered Oct 05 '22 15:10

zoecarver