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

Don't install a package twice from cache #804

Closed
yunxing opened this issue Oct 12, 2016 · 3 comments
Closed

Don't install a package twice from cache #804

yunxing opened this issue Oct 12, 2016 · 3 comments

Comments

@yunxing
Copy link
Contributor

yunxing commented Oct 12, 2016

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Some package installation are not idempotent. If you call post-install twice, the second installation may fail. Currently, after we install a package, we store the build artifacts in the cache. During the second installation, if we call postinstall on the package again, it may fail.

Repro
An example of this is ocamlRe. If you do

yarn install ocamlRe
rm -rf node_modules
yarn install ocamlRe 

the second installation will fail.

@LeiZeng
Copy link

LeiZeng commented Oct 12, 2016

I have the same question, which I don't think it's a "issue".

yarn install some-package
rm -rf node_modules/one-dependency

yarn check
# you can get the warning that the `one-dependency` is missing

yarn install
# success Already up-to-date.

yarn check
# you can get the warning that the `one-dependency` is missing

yarn install does not check the status first.

The solution is simple:
yarn install --force or yarn --force

Could be better if it can check and fix itself

@hpurmann
Copy link
Contributor

I guess this should be closed as #805 is merged now?

@wyze wyze removed the needs triage label Nov 16, 2016
@wyze
Copy link
Member

wyze commented Nov 16, 2016

Yup, thanks @hpurmann!

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

No branches or pull requests

5 participants