-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
yarn prune docs lie #6897
Comments
Interesting. Yarn has an optimization mechanism that will simply not run the install if it detects that your package.json didn't change. Meaning that when running In this case (reproduced by |
Any updates on this?
Removing entries from |
I think there's also some merit to keeping the current behavior as is, i.e. many node packages stuff additional folders into node_modules that can be safely kept (e.g. angular's ngcc) between installations. If you need to prune, you can always run Edit: You're absolutely right about the docs being misleading though |
The |
Please provide a working On our CI we cache the If manually doing Running
|
Do you want to request a feature or report a bug?
bug
What is the current behavior?
^ This is a lie.
If the current behavior is a bug, please provide the steps to reproduce.
node_modules/foo
will still be thereIn contrast
yarn install --force
does removenode_modules/foo
.What is the expected behavior?
You tell me? Either docs should be updated or behaviour of
yarn install
changed.According to docs
yarn install
should prune unnecessary deps.Why:
I had in project 2 dependencies having
foo
as dependency. One was pointing tofoo
asdependency
and the other was pointing asoptionalDependency
. I got rid of one withdependency
and I'm using----ignore-optional
on deployment. The thing is thefoo
dependency wasn't really optional but I detected it a little too late because I still had stalefoo
in node_modules.If docs were honest I would simply run
rm -rf node_modules
beforeyarn install
on deployments to ensure such things don't happen again.Please mention your node.js, yarn and operating system version.
node 6.14.3, yarn 1.13.0 and macOS sierra
The text was updated successfully, but these errors were encountered: