pnpm: pnpm doesn't install all project dependencies

pnpm version: 7.17.1

Code to reproduce the issue:

Expected behavior:

Running pnpm install and have all project dependencies installed in the node_modules folder.

Actual behavior:

I run pnpm install to install all my project dependencies but not all dependencies are installed in node_modules folder.~ I get build errors saying some modules are not installed.

When taking a look at node_modules folder is much smaller than the one generated by npm install.

Additional information:

  • node -v prints: node version 14.20.1
  • Windows, macOS, or Linux?: Windows

Thanks

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 13
  • Comments: 16

Most upvoted comments

I looked into this further and found that deleting your local virtual store (.pnpm) fixes it.

If you don’t have a custom virtual-store-dir configured for your project, just run rm -rf **/node_modules from the root of your repo followed by pnpm install.

I believe this is happening due to some mutation of a dependency in the virtual store that causes pnpm install to fail partway through while still reporting no errors. In my case, pnpm store status always returned esbuild as modified, even after a store removal and reinstall.

This bug still exists in pnpm@12.2 with monorepo (turborepo). For example if I install package @remix-run/node which requires @remix-run/server-runtime the latter is installed only in root node_modules but there is no reference to it in apps/my-app/node_modules.

The same happens even when I try to use pnpm deploy. The package is not in exported node_modules and it results in Error: Cannot find module '@remix-run/server-runtime' during runtime.

Any idea how to make it appear in apps/my-app?

Hi,

I was able to build sucessfully a small project, didn’t test my big project. However, I detected that in the local virtual store pnpm downloads several versions of the same dependency.

My dependencies:

image

My .pnpm folder:

image

How can I guarantee that pnpm only downloads the node_modules for the versions I have in package.json?

Thanks

Thanks,