Home > Blockchain >  Unable to install react-navigation-header-buttons
Unable to install react-navigation-header-buttons

Time:04-20

I had installed an old version before,but i want to upgrade to version 8, but I dont know how to face these errors

these are the current errors i am facinh

   npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR!
    npm ERR! While resolving: [email protected]
    npm ERR! Found: @react-navigation/[email protected]
    npm ERR! node_modules/@react-navigation/native
    npm ERR!   @react-navigation/native@"~3.5.0" from [email protected]   
    npm ERR!   node_modules/react-navigation
    npm ERR!     react-navigation@"^3.11.1" from the root project
    npm ERR!   peer @react-navigation/native@"^3.1.1" from [email protected]
    npm ERR!   node_modules/react-navigation-drawer
    npm ERR!     react-navigation-drawer@"~1.2.1" from [email protected]  
    npm ERR!     node_modules/react-navigation
    npm ERR!       react-navigation@"^3.11.1" from the root project
    npm ERR!   1 more (react-navigation-stack)
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! react-navigation-header-buttons@"8.0.0" from the root project
    npm ERR!
    npm ERR! Conflicting peer dependency: @react-navigation/[email protected]       
    npm ERR! node_modules/@react-navigation/native
    npm ERR!   peer @react-navigation/native@">=5" from [email protected]
    npm ERR!   node_modules/react-navigation-header-buttons
    npm ERR!     react-navigation-header-buttons@"8.0.0" from the root project  
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR!

CodePudding user response:

UPDATE (got the solution):

install a lower version of react-navigation-header-button. version 6 worked for me.

CodePudding user response:

In your package, you have @react-navigation/native version 3.5.0.

Try to upgrade @react-navigation/native version to >=5 using

npm i @react-navigation/native@latest or npm i @react-navigation/native@version_you_want(>=5)

Then you can use react-navigation-header-buttons to version 8.0.0

Or as an alternative

You can use npm i --legacy-peer-deps if you can not have to upgrade @react-navigation/native package

  • Related