Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm doesn't install all project dependencies #5716

Open
miguelisidoro opened this issue Nov 29, 2022 · 4 comments
Open

pnpm doesn't install all project dependencies #5716

miguelisidoro opened this issue Nov 29, 2022 · 4 comments

Comments

@miguelisidoro
Copy link

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

@hmnd
Copy link

hmnd commented Nov 30, 2022

Suddenly experiencing this here too, with both 7.14.2 and 7.17.1 (on Node v16.17.1)

Strangely, when I filter for a specific project that didn't have its dependencies installed, the dependencies do get installed correctly. Eg. if project2 didn't get a node_modules folder from pnpm install, pnpm install --filter project2 creates the node_modules folder correctly.

@sabasayer
Copy link

I got this error on a monorepo, to solve temporarily i had to add all packages to root package.json as dev dependency.

@hmnd
Copy link

hmnd commented Dec 1, 2022

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.

@miguelisidoro
Copy link
Author

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants