# Install pnpm as standalone

**URL:** https://discourse.nixos.org/t/install-pnpm-as-standalone/31841
**Category:** Help
**Created:** [August 17, 2023, 2:49pm UTC](https://discourse.nixos.org/t/install-pnpm-as-standalone/31841 "2023-08-17T14:49:29Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![paulovieira](https://discourse.nixos.org/user_avatar/discourse.nixos.org/paulovieira/32/6064_2.png) [@paulovieira](https://discourse.nixos.org/u/paulovieira)
#### Post date: [July 8, 2024, 4:43pm UTC](https://discourse.nixos.org/t/install-pnpm-as-standalone/31841/5 "2024-07-08T16:43:10Z")

</div>

> [@CobyPear](#):
>
> It looks like pnpm is only available in nixpkgs via `corepack`, which I was not able to get working.

I used to install `pnpm` using the “standalone installation”, as described in the initial post, but I’m now using it with success via the [corepack](https://github.com/NixOS/nixpkgs/blob/194846768975b7ad2c4988bdb82572c00222c0d7/pkgs/development/web/nodejs/corepack.nix) nix package. Quick example:

```sh
~$ mkdir testing-pnpm
~$ cd testing-pnpm/
~/testing-pnpm$ nix-shell -p nodejs_22 corepack_22

# ...

[nix-shell:~/testing-pnpm]$ which pnpm
/nix/store/kmm9fi163v374gv6i9qyi3crrhy85r1l-corepack-nodejs-22.3.0/bin/pnpm
[nix-shell:~/testing-pnpm]$
[nix-shell:~/testing-pnpm]$
[nix-shell:~/testing-pnpm]$ pnpm --version
! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-9.5.0.tgz
? Do you want to continue? [Y/n] Y

9.5.0

```

When we add some npm package for the first time, it will automatically add the `packageManager` field to `package.json`:

```sh
[nix-shell:~/testing-pnpm]$ pnpm init
[nix-shell:~/testing-pnpm]$ pnpm add underscore
! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager

Packages: +1
+
Progress: resolved 1, reused 0, downloaded 1, added 1, done

dependencies:
+ underscore 1.13.6

Done in 2.1s

[nix-shell:~/testing-pnpm]$ 

```

Here is how `package.json` looks like now:

```json
{
  "name": "testing-pnpm",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903",
  "dependencies": {
    "underscore": "^1.13.6"
  }
}

```

---

_[View the full topic](https://discourse.nixos.org/t/install-pnpm-as-standalone/31841)._
