-
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
Peer Dependency Not Hoisting Along With Other Package #4446
Comments
I downloaded and installed Yarn 0.27.5 (The last, officially released, version of Yarn). $ yarn --version
0.27.5 I ran through an installation within the $ ls node_modules/tslint/
bin CHANGELOG.md lib LICENSE node_modules package.json README.md
$ gulp lint
[17:01:55] Using gulpfile ~\Workspace\dependency-hoisting\application\gulpfile.js
[17:01:55] Starting 'lint'...
[17:01:55] Finished 'lint' after 321 ms |
Thank you very much for the detailed and clear report! That said this is not a bug, an expected behavior. Your If your project relies on |
The
I would expect that I was hoping Yarn would see the peer dependency |
I think that's fair. That said Yarn's algorithm works to satisfy the node
Based on your explanation, it actually seems to be relying on tslint's existence on the top level whcih indicates that it relies on it. If you disagree, I'd be interested in hearing your reasoning. |
@destroyerofbuilds I'm right there with you. Yarn 1.0+ is basically unusable at this point for me. Running the install command fails every time complaining of not being able to find some peer dependency. And since it fails and the install command doesn't complete... when I try to install the missing dependency it fails on some other missing dependency causing a sad circle of fail.
So I try to install request module ...
This is where I go back to using v0.27.5 which works perfectly.
|
Our So, Therefore we wouldn't expect the application to install |
It's Is it acceptable for packages like |
@destroyerofbuilds okay, thanks a lot for the detailed explanation. I've looked at all package.json files and it looks like there's some incorrect hoisting happening somewhere. In this case, the expected behavior is for Please keep your repo that shows this around until we resolve this bug. Thanks again for your time and help! |
**Summary** Fixes #4446, fixes #4433. Follow up to #3893. The fix in #3893 was too aggressive, allowing only top-level dependencies to be used in peer dependency resolution which was incorrect. This patch allows resolving peer dependencies from the same or higher levels in the dependency tree. **Test plan** Additional unit and integration tests.
…4478) **Summary** Fixes #4446, fixes #4433, fixes #2688, fixes #2387. Follow up to #3803. The fix in #3893 was too aggressive, allowing only top-level dependencies to be used in peer dependency resolution which was incorrect. This patch allows resolving peer dependencies from the same or higher levels in the dependency tree. **Test plan** Additional unit and integration tests.
…arnpkg#4478) **Summary** Fixes yarnpkg#4446, fixes yarnpkg#4433, fixes yarnpkg#2688, fixes yarnpkg#2387. Follow up to yarnpkg#3803. The fix in yarnpkg#3893 was too aggressive, allowing only top-level dependencies to be used in peer dependency resolution which was incorrect. This patch allows resolving peer dependencies from the same or higher levels in the dependency tree. **Test plan** Additional unit and integration tests.
Do you want to request a feature or report a bug?
A bug.
What is the current behavior?
I have a project that depends on a build tool, a build tool which exports Gulp tasks.
Package examples can be seen here - https://github.com/destroyerofbuilds/dependency-hoisting
From within the
application/node_modules/
directory you will see a package calledgulp-tslint
:gulp-tslint
is a dependency ofbuild-tool
, the development dependency of theapplication
project.gulp-tslint
has a peer dependency ontslint
.built-tool
also liststslint
as a dependency.However,
tslint
was not hoisted to the top-levelapplication/node_modules/
directory:$ ls node_modules/tslint ls: cannot access 'node_modules/tslint': No such file or directory
Running
gulp lint
, I observe the following error:That error is thrown by the following
require
ingulp-tslint
- https://github.com/panuhorsmalahti/gulp-tslint/blob/53534f8fc57b405551559ed336be38ebda172bf1/index.js#L6If the current behavior is a bug, please provide the steps to reproduce.
Please follow the steps in the Steps section - https://github.com/destroyerofbuilds/dependency-hoisting#steps
What is the expected behavior?
I would expect that
tslint
would be hoisted to the project's top-levelnode_modules/
directory, along sidegulp-tslint
.Please mention your node.js, yarn and operating system version.
$ yarn --verison yarn install v1.0.2 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... info Lockfile not saved, no dependencies. Done in 0.10s. $ node --version v6.11.3
Operating system is Windows 10.
The text was updated successfully, but these errors were encountered: