-
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
Deps that add files outside of yarn add (e.g., selenium-standalone) have these files purged #1955
Comments
This is really anoying. I use Nightwatch for e2e tests, and before switching to Yarn I only needed to install that packaged and everything would just work. My workarround: add |
I'm increasingly thinking this should be addressed by the other packages (e.g. That said, it would be nice to make Yarn's behavior less surprising to new users, either by...
This may also help avoid accidental data loss... it seems unlikely, but I could imagine myself experimenting with making changes in-place to one of my deps (with the goal of eventually cloning its repo and opening a PR) only to have a new file containing some of my work unexpectedly |
I'm having this issue too, with Yarn removing the Selenium files. In addition to 1,2,3 above, perhaps: 4. A command line flag, e.g. |
This is occurring in master HEAD (#977497a71d57ed499d154d9a025d7d559f81a54c) presently where native packages are having their build artifacts deleted on the 2nd run of EDIT: This is on EDIT 2: It only happens when using EDIT 3: I happens without IOW, what I'm seeing might be related to the OP. It was very difficult to reproduce, and wasn't able to debug before it inexplicably went away. |
Great explanation, @msegado. Does anyone (@msegado?) want to help the project with the direction in this area? A few random thoughts:
|
A follow up on this. If But I see 3 ways to solve this:
|
Same issue with
Running |
I've experienced many manifestations of this bug. It seems to be fixed in yarn init
yarn add postcss
yarn add leftpad
# Manually edit out leftpad from package.json & yarn.lock to simulate a git rebase
yarn install --check-files Previously, the above would cause That said, |
So the core issue is resolved! 🎉
This is an interesting idea. Mind creating a separate issue for tracking it? |
Do you want to request a feature or report a bug?
...bug? (It's unclear whether this should be yarn's responsibility or the installed package's)
What is the current behavior?
Yarn normally purges unexpected files found in
node_modules
as described in #231 (comment). To avoid purging build artifacts, yarn keeps a list of files created during the install process and doesn't remove those (see 3f765c3 for the latest implementation).Some packages, however, add files to their installation directory outside of the regular lifecycle hooks; selenium-standalone for example provides an
install
CLI command which downloads the selenium .jar and user-specified driver binaries to[project]/node_modules/selenium-standalone/.selenium
. Since these are not in yarn's list of artifacts, they're eventually purged.If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Before seeing #231, my expectation was that dependencies' folders would not be touched by yarn after they had been installed. I see a few ways forward:
If that this isn't a supported use case for yarn,
If this is a supported use case for yarn, modify the purging implementation to permit it.
Please mention your node.js, yarn and operating system version.
yarn 0.17.6
Node 6.9.1
OS X 10.11.6
...Thanks for the great tool! 📦
The text was updated successfully, but these errors were encountered: