# npm, Packages and Build Tooling

> Manage dependencies with npm or pnpm, understand package.json and lockfiles, and use Vite, ESLint and Prettier. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/full-stack/npm-and-tooling
Last updated: 2026-11-28

Manage dependencies with npm or pnpm, understand package.json and lockfiles, and use Vite, ESLint and Prettier.

Beginner · about 4 hours · difficulty 2/5

Learn first: [JavaScript Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/javascript-basics), [Terminal and Command Line](https://www.internhack.in/roadmaps/tracks/full-stack/terminal-basics)

Modern JavaScript is assembled from packages. Understanding the tooling turns mysterious install and build errors into routine fixes.

### package.json

- **dependencies** ship with your app; **devDependencies** are for building and testing.
- **scripts** like dev, build, test and lint are the commands your team and CI run.
- **Semantic versioning**: ^1.4.2 allows minor and patch upgrades. Know what that means before you upgrade.

### Lockfiles

package-lock.json or pnpm-lock.yaml pin exact versions so everyone installs the same tree. Commit it. Use npm ci in CI for clean, reproducible installs.

### Package managers

npm comes with Node.js. **pnpm** is faster and stricter about undeclared dependencies and is popular in monorepos. Pick one per project and stick to it.

### Build and quality tools

- **Vite**: fast dev server and bundler for React apps.
- **ESLint**: catches bugs and enforces conventions.
- **Prettier**: formats code so reviews focus on logic.

### Pitfalls

- Installing a package for something a few lines of code can do. Every dependency is a security and maintenance cost.
- Deleting the lockfile to "fix" errors.
- Mixing npm and pnpm in one repo.

You are ready to move on when you can start a Vite project, add ESLint and Prettier, write custom scripts, and explain the difference between npm install and npm ci.

## Key concepts

- **package.json and scripts**
- **Dependencies vs devDependencies**
- **Semantic versioning**
- **Lockfiles and npm ci**
- **pnpm**
- **Vite**
- **ESLint and Prettier**
- **npm audit**

## Mini project

Scaffold a Vite project, add ESLint and Prettier with a pre-commit check, write scripts for dev, build, lint and format, and document them in the README.

## Check yourself

Why should CI run npm ci instead of npm install, and why must the lockfile be committed?

## Free resources

- [npm Docs](https://docs.npmjs.com/) (npm)
- [Vite Guide](https://vite.dev/guide/) (Vite)
- [ESLint: Getting Started](https://eslint.org/docs/latest/use/getting-started) (ESLint)

Previous: [Asynchronous JavaScript and fetch](https://www.internhack.in/roadmaps/tracks/full-stack/async-javascript) · Next: [TypeScript Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/typescript)

## More in JavaScript for the Whole Stack

- [JavaScript Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/javascript-basics)
- [The DOM and Browser APIs](https://www.internhack.in/roadmaps/tracks/full-stack/dom-and-browser-apis)
- [Asynchronous JavaScript and fetch](https://www.internhack.in/roadmaps/tracks/full-stack/async-javascript)
- [npm, Packages and Build Tooling](https://www.internhack.in/roadmaps/tracks/full-stack/npm-and-tooling)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Full-Stack Developer Roadmap](https://www.internhack.in/roadmaps/tracks/full-stack)
