Skip to content

npm install fails after creating a fresh libraryΒ #782

@lufinkey

Description

@lufinkey

Description

After running create-react-native-library, when trying to call npm install either in the module folder or the generated example folder, I get the following error:

npm warn ERESOLVE overriding peer dependency
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: @types/[email protected]
npm error node_modules/@types/react
npm error   peerOptional @types/react@"^19.0.0" from @react-native/[email protected]
npm error   node_modules/react-native/node_modules/@react-native/virtualized-lists
npm error     @react-native/virtualized-lists@"0.78.0" from [email protected]
npm error     node_modules/react-native
npm error       dev react-native@"0.78.0" from the root project
npm error       2 more (testrnlib-example, @react-native/virtualized-lists)
npm error
npm error Could not resolve dependency:
npm error peerOptional @types/react@"^19.0.0" from [email protected]
npm error node_modules/react-native
npm error   dev react-native@"0.78.0" from the root project
npm error   react-native@"0.78.0" from [email protected]
npm error   example
npm error     [email protected]
npm error     node_modules/testrnlib-example
npm error       workspace example from the root project
npm error   1 more (@react-native/virtualized-lists)
npm error
npm error Conflicting peer dependency: @types/[email protected]
npm error node_modules/@types/react
npm error   peerOptional @types/react@"^19.0.0" from [email protected]
npm error   node_modules/react-native
npm error     dev react-native@"0.78.0" from the root project
npm error     react-native@"0.78.0" from [email protected]
npm error     example
npm error       [email protected]
npm error       node_modules/testrnlib-example
npm error         workspace example from the root project
npm error     1 more (@react-native/virtualized-lists)
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/luisfinke/.npm/_logs/2025-03-02T20_20_54_687Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/luisfinke/.npm/_logs/2025-03-02T20_20_54_687Z-debug-0.log

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

This error happens after creating a fresh project using create-react-native-library

Link to repro

N/A

Environment

macOS, node v22.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions