Skip to content

Package Manager

A package manager is a tool that allows you to manage your dependencies and automate the process of installing and updating them.

Solution: pnpm

pnpm is a fast, disk space-efficient package manager whose strictness helps prevent dependency tree bugs.

Install pnpm

You can install pnpm following the instructions on the pnpm installation guide.

You can expect the same functionalities and commands as npm or yarn. You can find the important commands in the pnpm docs.

Terminal window
pnpm install # install your project dependencies
Terminal window
pnpm add <package> # add a new dependency
Terminal window
pnpm init # initialize a new project

Recipe: pnpm with Github Actions

You can use the pnpm/action-setup action to install pnpm in your CI/CD pipeline. Here is an example of a Github Actions workflow:

steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm"
- name: Install dependencies
run: pnpm install