liveBook · Manning

Nvm

As explained in Road to Kubernetes

nvm is a version manager for installing and switching between Node.js runtime versions.

nvm, the Node Version Manager, installs multiple Node.js versions so each project can use an appropriate runtime. It avoids relying on an outdated system package when an application needs a newer release. section 3.4 section 3.4.2

A practical nvm setup follows these steps:

  • Install a chosen nvm release with the official installation script, piping its curl response to bash. section 3.4.2
  • Verify nvm with nvm --version, then install the latest LTS release or a specific Node.js version. section 3.4.2
  • Install application dependencies with npm install after entering the Node.js project directory. section 3.4.2

Installing nvm and Node.js

export NVM_VERSION="v0.39.3" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash nvm --version nvm install --lts nvm install 18.15.0 section 3.4.2

Listing 3.21 Installing the Node Version Manager
export NVM_VERSION="v0.39.3" #1
curl -o- \
    https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh \

    | bash

View the complete installation command, including the pinned nvm version and official installation URL. section 3.4.2

Listing 3.22 Verifying nvm is installed
nvm --version #1
nvm install --lts #2
nvm install 18.15.0 #3

Compare commands for verifying nvm and installing either the latest LTS release or a specific Node.js version. section 3.4.2

How Road to Kubernetes covers it

How deep it goes
Explains installation, version verification, LTS selection, and application dependency setup, but does not detail nvm's internal implementation.
Examples
Uses nvm v0.39.3, latest LTS installation, Node.js 18.15.0 installation, and npm dependency installation.
What it assumes
Assumes an Ubuntu-based SSH environment with bash and curl, while contrasting nvm with apt-based Node.js installation.
What you can do after
Operate/configure Node.js runtimes and install an Express.js application's npm dependencies.
How it connects
Connects Node.js runtimes with npm, Express.js applications, curl, bash, and Linux package management.

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.