microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.96k stars 602 forks source link

[rush] Peer deps error shows up even though it is explicitly present as a dependency #1756

Open ron4ex opened 4 years ago

ron4ex commented 4 years ago

Is this a feature or a bug?

Please describe the actual behavior. Here is the repo with a single package that has a few dependencies: https://github.com/ron4ex/rush-test

When I run rush update on this, why does it complain about @babel/core being not present even though it's explicitly added as a dependency?

The error is,

@rush-temp/cra > react-scripts > @svgr/webpack: @babel/plugin-transform-react-constant-elements@7.8.3 requires a peer of @babel/core@^7.0.0-0 but none was in
stalled.

But as you can see in https://github.com/ron4ex/rush-test/blob/master/apps/cra/package.json, @babel/core dependency is explicitly added.

If this is a bug, please provide the tool version, Node.js version, and OS.

stripathix commented 4 years ago

I too get this with

 ERROR  @vue/cli-plugin-unit-jest: vue-jest@3.0.5 requires a peer of vue@^2.x but none was installed.

Although i have already added it

  "peerDependencies": {
    "vue": "^2.x"
  },
briancmpbll commented 4 years ago

I also see this issue when I have two different versions of webpack used in projects.

I have a minimal repro of this in https://github.com/briancmpbll/rush-peer-dep-repro

Without the new-webpack project, there are no peer dependency warnings. When adding the new-webpack project, I get

 WARN  babel-loader@7.1.5 requires a peer of webpack@2 || 3 || 4 but none was installed.

even though the test-project package.json contains"webpack": "~3.10.0".

If I update the test-project package's webpack version to match that of the new-wepback project, the warning again goes away.

mikeharder commented 4 years ago

Looks similar to #1415