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 -vprints: 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
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-dirconfigured for your project, just runrm -rf **/node_modulesfrom the root of your repo followed bypnpm install.I believe this is happening due to some mutation of a dependency in the virtual store that causes
pnpm installto fail partway through while still reporting no errors. In my case,pnpm store statusalways 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/nodewhich requires@remix-run/server-runtimethe latter is installed only in rootnode_modulesbut there is no reference to it inapps/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 inError: 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:
My .pnpm folder:
How can I guarantee that pnpm only downloads the node_modules for the versions I have in package.json?
Thanks
Thanks,