Package Managers

Every tool in this book installs, pins or ships software that someone else wrote: Git 1,932 stores your lockfile, a Dockerfile runs npm 2,036 ci and apk add, and a Kubernetes 5,150 pod runs an image made mostly of other people's packages. A package manager decides what those packages are, so DevOps starts there.

JavaScript has four serious package managers in 2026: npm, Yarn 11,798 , pnpm 69,400 and Bun 73,307 . They read the same package.json and use the same registry, yet lay out node_modules differently, write different lockfiles and disagree about whether a dependency may run code during installation. This chapter installs BookNest, the bookshop API that runs through all seven chapters, with each of them and measures the results. It then covers the OS package managers that install Node.js 2,131 itself, other language ecosystems, and supply-chain attacks. npm itself is taught in MERN Stack Development, Packages and Monorepos and Security and the Supply Chain, and is not repeated here.

What you will learn

Sections