Do you want to request a feature or report a bug?
What is the current behavior?
When a hosted git dependency is installed, lifecycle scripts are not run (e.g.
If the current behavior is a bug, please provide the steps to reproduce.
yarn add user/repo or
yarn add github:user/repo. No lifecycle scripts will be run.
What is the expected behavior?
prepare should be run on install (like with npm@5)
Please mention your node.js, yarn and operating system version.
I’ve done some investigation as to why this broken. This is what I’ve found:
#3553 added the correct behavior, but only for git fetching, meaning the dependency was actually fetched via git.
Because Yarn recognizes certain git hosts, Yarn will install these dependencies via HTTP/tarball method instead of git (presumably for performance). So if this logic is triggered (which will happen with dependencies formatted like
github:repo/user, then the appropriate lifecycle scripts won’t be run.
I’d be interested in making a PR to resolve this, but figured I’d make an issue first. I’m thinking that the logic for running lifecycle scripts in
src/fetchers/git-fetcher.js should probably be moved into the more generic
src/fetchers/base-fetcher, since per #3911 lifecycle scripts should be run for non-git dependencies as well.