Repository: react-native
Issue: Warnings from react-native & @react-native/codegen about missing Peer Dependencies
Labels: Resolution: PR Submitted

### Description

Using yarn 3.6.4 (berry) on a new react-native project, I get the following dependency warnings:
```shell
$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.76.6 doesn't provide @babel/preset-env (pda3fc), requested by @react-native/codegen
➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (pd2efd), requested by @babel/plugin-syntax-flow
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/core (p230be), requested by babel-jest
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/preset-env (pe8640), requested by @react-native/codegen
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
```

Of these, it appears babel-plugin-transform-flow-enums isn't provided by this repository, but the rest of them are.

## Similar Past Issues / Pulls
- https://github.com/facebook/react-native/issues/35913
- https://github.com/facebook/react-native/pull/35915

### Steps to reproduce

1. Use yarn 3.6.4 (berry)
2. Create a new react-native project
3. `yarn install`

(Reproducer provided)

### React Native Version

0.76.6

### Affected Platforms

Runtime - Android, Runtime - iOS, Runtime - Web, Runtime - Desktop

### Output of `npx react-native info`

```text
info Fetching system and libraries information...
System:
  OS: macOS 15.1.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 365.08 MB / 64.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 23.6.0
    path: ~/.nvm/versions/node/v23.6.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v23.6.0/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v23.6.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.19072.14.2412.12360217
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
```


### Stacktrace or Logs

```text
$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.76.6 doesn't provide @babel/preset-env (pda3fc), requested by @react-native/codegen
➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (pd2efd), requested by @babel/plugin-syntax-flow
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/core (p230be), requested by babel-jest
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/preset-env (pe8640), requested by @react-native/codegen
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
```


### Reproducer

https://github.com/fbartho/react-native-peerDependencies-reproducer/

### Screenshots and Videos

```shell
{main} ~/Code/react-native-peerDependencies-reproducer/ReproducerApp $  yarn
➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍

➤ YN0000: ┌ Resolution step
➤ YN0061: │ eslint@npm:8.57.1 is deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
➤ YN0061: │ @humanwhocodes/config-array@npm:0.13.0 is deprecated: Use @eslint/config-array instead
➤ YN0061: │ @humanwhocodes/object-schema@npm:2.0.3 is deprecated: Use @eslint/object-schema instead
➤ YN0061: │ glob@npm:7.2.3 is deprecated: Glob versions prior to v9 are no longer supported
➤ YN0061: │ sudo-prompt@npm:9.2.1 is deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
➤ YN0032: │ fsevents@npm:2.3.3: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ rimraf@npm:3.0.2 is deprecated: Rimraf versions prior to v4 are no longer supported
➤ YN0061: │ inflight@npm:1.0.6 is deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
➤ YN0061: │ rimraf@npm:2.6.3 is deprecated: Rimraf versions prior to v4 are no longer supported
➤ YN0061: │ @babel/plugin-proposal-class-properties@npm:7.18.6 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
➤ YN0061: │ @babel/plugin-proposal-nullish-coalescing-operator@npm:7.18.6 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
➤ YN0061: │ @babel/plugin-proposal-optional-chaining@npm:7.21.0 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.76.6 doesn't provide @babel/preset-env (pda3fc), requested by @react-native/codegen
➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (pd2efd), requested by @babel/plugin-syntax-flow
➤ YN0002: │ react-native@npm:0.76.6 [9aafe] doesn't provide @babel/core (pde5e4), requested by babel-jest
➤ YN0002: │ react-native@npm:0.76.6 [9aafe] doesn't provide @babel/preset-env (p29d64), requested by @react-native/codegen
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 11s 275ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ yargs-parser@npm:18.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs-parser@npm:21.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:15.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs@npm:17.7.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yocto-queue@npm:0.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 0s 549ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 4s 3ms
➤ YN0000: Done with warnings in 15s 943ms

{main} ~/Code/react-native-peerDependencies-reproducer/ReproducerApp $  yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.76.6 doesn't provide @babel/preset-env (pda3fc), requested by @react-native/codegen
➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (pd2efd), requested by @babel/plugin-syntax-flow
➤ YN0002: │ react-native@npm:0.76.6 [9aafe] doesn't provide @babel/core (pde5e4), requested by babel-jest
➤ YN0002: │ react-native@npm:0.76.6 [9aafe] doesn't provide @babel/preset-env (p29d64), requested by @react-native/codegen
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 0s 446ms
```