liveBook · Manning

Npm

As explained in Road to Kubernetes

npm is the package manager and registry ecosystem commonly used to install and manage Node.js packages.

npm is Node.js’s package manager for installing and managing third-party packages. It keeps installations local to the project directory and records dependencies in package.json. section 2.2

Set up a Node.js project with a short, repeatable workflow:

  • Run npm init in the project root and answer its setup prompts. section 2.2
  • Run npm install express to install Express.js locally. section 2.2
  • Inspect package.json to see the dependency npm added automatically. section 2.2

Installing Express.js

From a newly initialized JavaScript project, run npm install express. npm installs Express.js in the local project and adds its version to package.json, avoiding manual dependency editing. section 2.2

Listing 2.12 Initializing a new Node.js project
npm init

Use the npm init listing to see the command that creates a new Node.js project and generates package.json. section 2.2

Listing 2.14 Installing Express.js
npm install express

Use the Express.js installation listing to follow the package-installation step. section 2.2

How Road to Kubernetes covers it

How deep it goes
Explains initialization, local installation, and package.json tracking without descending into npm internals.
Examples
Uses npm init, npm install express, package.json, and project-directory listings as practical examples.
What it assumes
Assumes Node.js is installed and introduces npm as its built-in package manager.
What you can do after
Apply it via npm to initialize projects, install Express.js, and record dependencies automatically.
How it connects
Connects Node.js, Express.js, package.json, nvm, and dependency management.

Also explained in

Compare how 5 books explain npm →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.