Questions tagged [pnpm]

pnpm uses hard links and symlinks to save one version of a module only ever once on a disk. When using npm or Yarn for example, if you have 100 projects using the same version of lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be saved in a single place on the disk and a hard link will put it into the node_modules where it should be installed. As a result, you save space on your disk and you have a lot faster installations!

Use this tag to ask questions about the package manager. If you find any issue or would like to suggest an improvement, please use the GitHub repository issues list.

For more information check the package description and the repository.

376 questions
51
votes
1 answer

nodejs will not enable corepack: operation not permitted

I have installed nodejs and i am trying to enable corepack with corepack enable but it gives me this error on windows: Internal Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\pnpm' Error: EPERM: operation not permitted, open…
Nadia Hansen
  • 697
  • 2
  • 6
  • 16
42
votes
5 answers

pnpm peer dependencies auto-install

How (or on which file) to set true to do auto install dependencies ? my terminal error: hint: If you want peer dependencies to be automatically installed, set the "auto-install-peers" setting to "true". hint: If you don't want pnpm to fail on peer…
fedoraname1
  • 531
  • 1
  • 3
  • 8
33
votes
3 answers

Can I use npx with pnpm?

Can I use npx together with a pnpm install? It doesn't seem to work and pnpx fetches remote dependencies, it seems more like npm create. Is there a way to use npx with pnpm to execute local binaries or is there a different pnpm equivalent?
Matt Sanders
  • 8,023
  • 3
  • 37
  • 49
32
votes
2 answers

pnpm equivalent command for npm ci

What is the equivalent command for npm ci in pnpm? According to the documentation for npm install: pnpm install is used to install all dependencies for a project. In a CI environment, installation fails if a lockfile is present but needs an…
BuZZ-dEE
  • 6,075
  • 12
  • 66
  • 96
21
votes
1 answer

How to remove a package from pnpm store, or force re-download it?

I use pnpm to manage npm project, and I modified the content of an installed package by accident, say, I cleared the content of node_modules/jquery/dist/jquery.js. The problem is no matter how i reinstall jquery(pnpm install jquery), the content of…
Freewind
  • 193,756
  • 157
  • 432
  • 708
20
votes
5 answers

How to get pnpm store directory

Is there any way how to check directory/path of pnpm store? I know you can set it with npm config set store /path/to/.pnpm-store, but npm config get store in my case returns undefined, which I guess means to pnpm to use some default, but where can I…
mauron85
  • 1,364
  • 1
  • 14
  • 28
17
votes
2 answers

How to add dependency to PNPM workspace?

I start using PNPM Workspaces, and I'm struggling in how to add dependencies to any specific workspace as I would do in yarn running: yarn workspace add Or even running scripts for specific packages as I would do…
Arnautg
  • 661
  • 6
  • 10
16
votes
0 answers

PNPM linking with standalone NextJS build

I'm trying to create production Dockerfile using NextJS standalone mode and PNPM. In next.config.js i have output configuration: experimental: { outputStandalone: true, outputFileTracingRoot: path.join(__dirname, '../../'), }, And in…
Dooomel
  • 536
  • 5
  • 17
16
votes
1 answer

Can I delete package-lock.json when switching to pnpm?

I'm in the process of switching from npm to pnpm, which has a different set of features that I prefer. The former uses package-lock.json to lock exact packages versions, the latter pnpm-lock.yaml. According to the docs, pnpm ignores…
Sekhemty
  • 1,222
  • 2
  • 13
  • 33
15
votes
5 answers

How do you switch between pnpm versions?

I'm currently working on an application that uses pnpm 6 but I have pnpm 7 installed. I couldn't find any documentation that shows me how to install and switch between versions. Thank you!
Shey Umar
  • 151
  • 1
  • 1
  • 3
15
votes
4 answers

How to pnpm and Next.js in multi-stage docker file?

The official Next.js Dockerfile example does not work if I switch npm to pnpm. How should I modify that Dockerfile so that it remains multi-stage, but also uses pnpm instead of npm?
Meglio
  • 1,646
  • 2
  • 17
  • 33
13
votes
1 answer

What is difference between pnpm create, pnpx, dlx?

The pnpm package manager offers three commands that are alternatives for npm's npx command. These are pnpm create, pnpx and pnpm dlx. All three seem to do the same thing. But what are the differences between them? Which one should be preferred for…
Arctomachine
  • 401
  • 6
  • 12
12
votes
0 answers

Typescript pnpm monorepo, path aliases conflicts between local dependencies during build

I have a PNPM with TurbeRepo monorepo, used this template. In this monorepo I have a NextJS app that uses a ui-shared package (local shared code, not actually an npm package). The ui-shared is made in the likes of but my package is of course much…
Nikola-Milovic
  • 1,393
  • 1
  • 12
  • 35
12
votes
3 answers

How do I use pnpm in my Angular project to manage packages?

I am searching for a way to have one node_modules folder to use in my different projects. I found pnpm, installed it, and created one project with the commands: ng new test-pnpm --skip-install ng config cli.packageManager pnpm pnpm install ng…
Mohsen Saleh
  • 139
  • 1
  • 10
11
votes
2 answers

How to migrate a project from npm to pnpm

We have built a project with a deep tree of dependencies with npm install and have a lot of issues under Microsoft Windows (secondary target). I have read about pnpm and it seems to be a solution for us. How to migrate our nested repository? Build a…
Aubin
  • 14,617
  • 9
  • 61
  • 84
1
2 3
24 25