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 prune --prod doesn't work correctly with workspaces #2396

Closed
jackyef opened this issue Mar 5, 2020 · 4 comments
Closed

pnpm prune --prod doesn't work correctly with workspaces #2396

jackyef opened this issue Mar 5, 2020 · 4 comments
Labels
area: monorepo Everything related to the pnpm workspace feature type: feature

Comments

@jackyef
Copy link

jackyef commented Mar 5, 2020

pnpm version: 4.11.1

Code to reproduce the issue:

Clone this repo: https://github.com/jackyef/pnpm-prune-bug

  1. Install all dependencies

    pnpm recursive install
    
  2. Check node_modules size

    du -sh node_modules # 27M
    
  3. Prune devDeps

    pnpm recursive prune --prod
    
  4. Check node_modules size

    du -sh node_modules # Still 27M!
    
  5. Clean up node_modules manually

    rm -rf ./node_modules
    rm -rf ./packages/*/node_modules
    
  6. Install deps without devDeps

    NODE_ENV=production pnpm recursive install
    
  7. Check node_modules size

    du -sh node_modules # 488K!
    

Expected behavior:

node_modules/.pnpm/registry.npmjs.org/webpack shouldn't exist after pruning.

Actual behavior:

It still exist after

pnpm recursive install
pnpm recursive prune --prod

Additional information:

Node: v10.16.2
OS: OS X

@zkochan
Copy link
Member

zkochan commented Mar 14, 2020

As a temporary solution, you may run pnpm recursive install --prod or a shorter version pnpm install -rP

The prune command does not support recursive execution on a monorepo currently.

@zkochan zkochan added area: monorepo Everything related to the pnpm workspace feature type: feature labels Mar 14, 2020
@jackyef
Copy link
Author

jackyef commented Mar 18, 2020

@zkochan Would you say this is a doable issue for first-time contributor to the project? If you do, I am interested in helping out. Really liking the project 👍

@zkochan
Copy link
Member

zkochan commented Mar 18, 2020

I do encourage you to contribute but this one is not the best one to start with, I think.

@zkochan
Copy link
Member

zkochan commented May 8, 2022

This is probably fixed by #4691

@zkochan zkochan closed this as completed May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: monorepo Everything related to the pnpm workspace feature type: feature
Projects
None yet
Development

No branches or pull requests

2 participants