How do I generate a package-lock.json file?

Asked 2 years ago

Another question, also, is why do I need to have a package-lock file? I've been following along to a React tutorial but it wasn't really explained why.

Samuel Hobbs

Monday, July 18, 2022

The package-lock.json file is used to lock down the versions of your dependencies so that your project will always use the same versions, regardless of when you install it. To generate this file, you can use the "npm install" command with the "--save-exact" flag.

1





Write an answer...

Cancel

Please follow our  Community Guidelines

Can't find what you're looking for?