Section: Installing dependencies

Install globally

bash
bash
npm install -g <package>
Explanation

Install a CLI tool globally.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Installing dependencies
Install a package
Install a runtime dependency.
OpenIn sheetbashsame section
Install a specific version
Install an exact version.
OpenIn sheetbashsame section
Install a dev dependency
Add a development dependency.
OpenIn sheetbashsame section
Install an optional dependency
Add an optional dependency.
OpenIn sheetbashsame section
Install as peer dependency
Add a peer dependency entry.
OpenIn sheetbashsame section
Install without saving
Install a package without editing package.json.
OpenIn sheetbashsame section