Do you want to request a feature or report a bug?
Bug
What is the current behavior?
In workspaces, peerDependencies
that are also present as devDependencies
are reported as unmet.
If the current behavior is a bug, please provide the steps to reproduce.
Clone https://github.com/sky87/unmet-peer-deps-issue, run
$ yarn
yarn install v1.6.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "workspace-aggregator-b6d53714-1712-40de-af51-af5d0487ed3e > a@1.0.0" has unmet peer dependency "react@^16.0.0".
warning "workspace-aggregator-b6d53714-1712-40de-af51-af5d0487ed3e > a@1.0.0" has unmet peer dependency "react-dom@^16.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 4.49s.
What is the expected behavior?
Yarn should not issue a warning.
Notice that without workspaces everything works as expected.
$ rm -rf node_modules && mv package.json _package.json && cd packages/a && yarn
yarn install v1.6.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 2.04s.
Please mention your node.js, yarn and operating system version.
$ yarn -v
1.6.0
$ node -v
v9.3.0
$ ver
Microsoft Windows [Version 10.0.16299.431]
I don’t think I’m using the workspace feature, but am getting the following error despite the fact that
babel-runtime@6.26.0
is installed. I think it’s because I’m usingdevDependencies
as well.warning “react-intl-cra > babel-preset-react-app@3.1.1” has unmet peer dependency “babel-runtime@^6.23.0”.
My packages:
Bumping as this is still an issue in yarn 1.15
Yea, I’m seeing this as well. We have our mono-repo broken into two workspaces. A
services
workspace, and apackages
workspace. The projects inpackages
get imported into theservices
projects. We often want our packages to just define a peerDep for a certain library, so that theservices
have some flexibility on the exact version they install.The problem I run into is that any package that defines a peerDep, ends up throwing a warning, depsite the face that the dep is also installed as a devDep in that package, and the service that imports it has the peerDep installed into it’s main dependencies.
This is a pretty serious annoyance as our project is growing. So many of our workspace packages depend on peerDeps that the list of warnings that mean nothing is growing and growing.
Bumping for update
Same issue for me. I checked my peer dependencies. They are correct but I get these warnings
Same issue 🙁
+1
Does anyone know if this is resolved with Yarn 2? I haven’t made the switch yet but I would be OK with having to in order to fix this.
@rikkit I no longer have this problem with Yarn 2, 0 warning.
Yarn 2 is more strict on the resolution of peerDependancies but allows to make optionalPeerDependencies and/or to overload the packages with missing peerDependencies.
Closing as fixed in v2
https://yarnpkg.com/getting-started/migration