Stage 2 · Lesson 2 of 8
npm, package.json and lockfiles
installs the libraries your project uses and runs its scripts. The file package.json lists two kinds of libraries. Dependencies are needed when the app runs, like . are only for building and testing, like eslint.
It also lists scripts such as dev, build and test, which you run with npm run dev and so on. A like ^19.1.0 allows newer minor and patch versions, so two installs could get different code. That is why package-lock.json records the exact versions installed.
Commit it, and use npm ci in automated pipelines to install exactly what the lockfile says. npx runs a package's command without installing it globally.
Common trapadding a large package for a small job. Every is code you ship and trust, so first check its size, how well it is maintained and its weekly downloads.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- GuideFreeReact Documentation
Meta
Free official course; Thinking in React and Managing State matter most
- CourseFreeNext.js Learn
Vercel · Intermediate
Free official course: the first chapters build pages, layouts and navigation