Why the lockfile matters
Same package.json, different day, different code. If 1.6.0 had a bug, Friday's build would break while Monday's worked. The lockfile keeps every machine on the version you tested.
npm is the package manager that comes with Node.js: package.json lists your project's name, scripts and the packages it depends on (with version ranges), node_modules holds the installed code, and the lockfile pins the exact versions so every install is identical.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 6 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write a function bumpType(oldVersion, newVersion) that returns "major", "minor", "patch" or "same".
Write the package.json scripts for a project that runs Vite in development, builds with vite build, lints with eslint . and runs the linter automatically before every build.
For each change, say which version number you bump: (a) fix a rounding bug; (b) add a new optional currency option; (c) rename the function format to formatPrice.
Explain it without notes
What is the difference between dependencies and devDependencies?
Explain semver and what ^, ~ and an exact version mean in package.json.
Why should you commit package-lock.json, and when do you use npm ci instead of npm install?
How do npm scripts find tools like vite and eslint?
Preview
Console
Nothing logged yet.Expected console output
Monday, npm install: chart-lib 1.5.0
Friday, no lockfile: chart-lib 1.6.0
Friday, npm ci with lockfile: chart-lib 1.5.0