Web Security · Junior · Question 74 of 75

Why should the lockfile (package-lock.json) be committed and installed with npm ci in CI?

Explanation

Without a lockfile, a version range can pull a freshly published malicious release. npm ci fails if the lockfile and package.json disagree.

Further reading

Problem with a question

Web Security · Junior · question 74

Test yourself

Take the Web Security · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz