Menu
User

DropVPS Team

Writer: Cooper Reagan

How to Install PNPM on Ubuntu 25.10

How to Install PNPM on Ubuntu 25.10

Publication Date

11/12/2025

Category

Articles

Reading Time

2 Min

Table of Contents

PNPM is a fast, disk-efficient package manager for Node.js projects — often preferred over npm and yarn for its speed and smart caching.

Step 1: Update System Packages

Start by updating your system to make sure all dependencies are up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install Node.js (If Not Installed)

PNPM requires Node.js to work. The easiest way to install the latest version is through NodeSource:

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

Verify the installation:

node -v
npm -v

Ubuntu 25.10’s Node.js builds usually include Corepack, which makes installing PNPM simple.

Enable Corepack:

sudo corepack enable

Then activate PNPM:

corepack prepare pnpm@latest --activate

Check the version:

pnpm -v

If you see a version number, PNPM is ready to use.

Step 4: Install PNPM Globally via NPM (Alternative Method)

If Corepack isn’t available or you prefer manual installation, use npm directly:

sudo npm install -g pnpm

Confirm installation:

pnpm -v

Step 5: Create a Test Project

You can verify that PNPM works properly by initializing a new Node.js project:

mkdir pnpm-test && cd pnpm-test
pnpm init

Install a sample package:

pnpm add axios

List installed packages:

pnpm list

Optional Step: Enable Shell Completion

For a smoother terminal experience, enable auto-completion for PNPM commands:

pnpm completion bash | sudo tee /etc/bash_completion.d/pnpm > /dev/null
source /etc/bash_completion

PNPM works perfectly with monorepos and large projects — if you’re switching from npm, just delete your node_modules folder and run:

pnpm install

You’ll notice faster installs and less disk usage instantly.

Linux VPS
U
Loading...

Related Posts