How to Install pnpm on AlmaLinux 10

Published: 2026-06-28
Google AdSense 广告位 (待申请通过后开启)

pnpm is a fast, disk-efficient package manager for Node.js. Compared with npm and yarn, pnpm uses a content-addressable storage system that significantly reduces disk usage and improves installation speed.

This guide explains how to install pnpm on AlmaLinux 10, verify the installation, configure it properly, and resolve common issues.

---

Prerequisites

Before installing pnpm, make sure:

* Node.js is installed on your system.

* npm is available (comes with Node.js).

* You have sudo privileges.

Check Node.js installation:

node -v

Check npm:

npm -v

If Node.js is not installed, please install it first:

* How to Install Node.js on AlmaLinux 10

---

Method 1: Install pnpm Using Corepack (Recommended)

Modern Node.js versions include **Corepack**, which allows you to manage package managers like pnpm easily.

Enable Corepack:

corepack enable

Prepare pnpm:

corepack prepare pnpm@latest --activate

Verify installation:

pnpm -v

If you see a version number, pnpm is installed successfully.

---

Method 2: Install pnpm Using npm

If Corepack is not available, you can install pnpm globally via npm.

sudo npm install -g pnpm

Verify installation:

pnpm -v

---

Set pnpm as Default Package Manager (Optional)

You can configure pnpm behavior globally.

Enable strict store:

pnpm config set store-dir ~/.pnpm-store

Check configuration:

pnpm config list

---

Create a Test Project

Initialize a new project:

mkdir pnpm-test
cd pnpm-test
pnpm init

Install a dependency:

pnpm add express

Run a simple test:

const express = require("express");
const app = express();

app.get("/", (req, res) => {
  res.send("Hello pnpm!");
});

app.listen(3000, () => {
  console.log("Server running on port 3000");
});

Run the app:

node index.js

---

Common Issues

### pnpm: command not found

This usually means pnpm is not installed or PATH is not updated.

Try:

source ~/.bashrc

or reinstall:

npm install -g pnpm

---

### Corepack not found

Your Node.js version may be too old.

Upgrade Node.js to a newer LTS version.

---

### Permission denied error

Avoid using root globally; instead configure npm prefix or use Corepack method.

---

pnpm vs npm vs yarn

* npm: default package manager

* yarn: alternative with workspaces

* pnpm: faster, more disk efficient, better monorepo support

---

Related Articles

* How to Install Node.js on AlmaLinux 10

* How to Install npm on Linux

* How to Install Yarn on AlmaLinux 10

* How to Install nvm on AlmaLinux 10

* How to Install Docker on AlmaLinux 10

---

Conclusion

pnpm is a modern and efficient package manager for Node.js that improves dependency installation speed and reduces disk usage. On AlmaLinux 10, the recommended method is using Corepack, but npm-based installation is also supported.

Once installed, pnpm works seamlessly with most Node.js projects and is especially useful for monorepo and large-scale applications.

Explore More

Technology Guides →

Southeast Asia Insights →