skip to Main Content

When running the following within Visual Studio Code:

npm install @react-navigation/bottom-tabs 

The following error is thrown:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"*" from @react-navigation/[email protected]
npm ERR!   node_modules/@react-navigation/core
npm ERR!     @react-navigation/core@"^6.4.9" from @react-navigation/[email protected]
npm ERR!     node_modules/@react-navigation/native
npm ERR!       peer @react-navigation/native@"^6.0.0" from @react-navigation/[email protected]
npm ERR!       node_modules/@react-navigation/drawer
npm ERR!         @react-navigation/drawer@"^6.6.3" from the root project
npm ERR!       4 more (@react-navigation/elements, ...)
npm ERR!   peer react@"*" from @react-navigation/[email protected]
npm ERR!   node_modules/@react-navigation/drawer
npm ERR!     @react-navigation/drawer@"^6.6.3" from the root project
npm ERR!   15 more (@react-navigation/elements, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from [email protected]
npm ERR! node_modules/react-navi
npm ERR!   react-navi@"^0.15.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.0" from [email protected]
npm ERR!   node_modules/react-navi
npm ERR!     react-navi@"^0.15.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! 
npm ERR! 

When running

npm install @react-navigation/bottom-tabs –force

or

npm install @react-navigation/bottom-tabs –legacy-peer-deps

The error changes to:

npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"*" from @react-navigation/[email protected]
npm WARN   node_modules/@react-navigation/core
npm WARN     @react-navigation/core@"^6.4.9" from @react-navigation/[email protected]
npm WARN     node_modules/@react-navigation/native
npm WARN   16 more (@react-navigation/drawer, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from [email protected]
npm WARN node_modules/react-navi
npm WARN   react-navi@"^0.15.0" from the root project
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^16.8.0" from [email protected]
npm WARN   node_modules/react-navi
npm WARN     react-navi@"^0.15.0" from the root project
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/react-navigation/bottom-tabs.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

Up to this point, have had no issue installing react native packages.

Any help is mighty appreciated.

Thanks

2

Answers


  1. The error says:

    command git --no-replace-objects ls-remote ssh://[email protected]/react-navigation/bottom-tabs.git
    

    Which means that git doesn’t accept ssh links for the fetch of package install.

    An SSH URL necessitates the presence of a public key for initial user authentication, followed by access to the repository (a given privilege due to its public nature).

    You can setup npm to use HTTPS URLs instead of SSH:

    git config --global url."https://github.com/".insteadOf ssh://[email protected]/
    git config --global url."https://github.com/".insteadOf [email protected]:
    

    Here you got more related information:
    https://docs.github.com/en/authentication/connecting-to-github-with-ssh

    Or maybe you need to update npm to the lastest version:

    npm install npm@latest -g
    
    Login or Signup to reply.
  2. npm install @react-navigation/bottom-tabs –legacy-peer-deps
    this helped , thanks!.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search