React Navigation Error on npm install

10,250

Solution 1

I cant comment because I dont have the points, so heres a tentative answer with the info at the moment:

I had similar issue when running Expo on Windows. to solve I had to close XDE and reinstall.

if that's not enough, delete the "node_modules" folder and run "npm install".

Solution 2

It can be solved by running a npm install command again and reinstall the npm install --save react-navigation command.

Solution 3

They aren't errors, just warnings telling you that some peer dependencies that navigation relies on aren't installed. Based on your commands, you need to run npm install or yarn install to install all the packages. Creating the app with create-react-native app give you a list of packages but you have to actually install them with npm install. If something funky happens, do what @vbandrade suggested and hose your node_modules and package.lock, then do a fresh npm install

Solution 4

The same error appeared when I tried to run npm install --save react-navigation. Turns out I needed to run npm install prior to npm install --save react-navigation.

Share:
10,250
Malcolm Maima
Author by

Malcolm Maima

I code stuff... lots of stuff (^_^) I eat a lot too, coffee makes me sleepy Love cartoons and robots.

Updated on July 22, 2022

Comments

  • Malcolm Maima
    Malcolm Maima almost 2 years

    I'm trying to create a new react native app with react navigation.

    I did the following:

    1.) create-react-native-app myAppName

    2.) cd myAppName/

    3.) npm install --save react-navigation

    4.) Expecting successful installation of react-navigation but instead i get:

    C:\Users\Maima\Documents\GitHub\React\test>npm install --save react-navigation
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\jest.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
    est\node_modules\jest
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\jest as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
    node_modules\jest
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\rimraf.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
    \test\node_modules\rimraf
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\rimraf as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
    t\node_modules\rimraf
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\uuid.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
    est\node_modules\uuid
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\uuid as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
    node_modules\uuid
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\semver.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
    \test\node_modules\semver
    npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
    \.bin\semver as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
    t\node_modules\semver
    npm notice created a lockfile as package-lock.json. You should commit this file.
    
    npm WARN [email protected] requires a peer of react@* but none is i
    nstalled. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-native@* but no
    ne is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react@* but none is ins
    talled. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-native@* but none
     is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-nati
    ve@* but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react@* but none is
     installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-native@* but
    none is installed. You must install peer dependencies yourself.
    
    + [email protected]
    added 8 packages, removed 973 packages and updated 20 packages in 259.667s
    

    Please Help, Cant npm start my React Native App.

  • Rito
    Rito almost 4 years
    This was really helpful, it worked for me, simple and easy!!!
  • legenddaniel
    legenddaniel over 3 years
    Yes this works but it's really weird. Just keep trying and it will be done at certain times...
  • Tehleel Mir
    Tehleel Mir over 2 years
    thanks this worked on react native cli