1
votes

React Native Expo Users!

I am running into error on expo init with react-navigation (both blank & with tabs):

npm ERR! 404  '@react-navigation/[email protected]' is not in the npm registry.

I have been developing with React Native using Expo for several months now and have great success learning and solving errors along the way!

I took a holiday, came back to start a new project, and hit a wall with react-navigation@^3.0.0 - I have tried many solutions and nonwork.

I am using expo and npm to start a new project, both tabs and blank template have the react-navigation npm install issue:

expo init
? Choose a template: expo-template-tabs
? Choose which workflow to use: managed
✔ Please enter a few initial configuration values.
  Read more: https://docs.expo.io/versions/latest/workflow/configuration · 100% completed
? Yarn v1.13.0 found. Use Yarn to install dependencies? No
[08:18:30] Extracting project files...
[08:18:31] Customizing project...
[08:18:31] Initialized a git repository.
[08:18:31] Installing dependencies...
npm WARN deprecated [email protected]: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@react-navigation%2fnative - Not Found
npm ERR! 404
npm ERR! 404  '@react-navigation/[email protected]' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404  1. name can only contain URL-friendly characters
npm ERR! 404 It was specified as a dependency of 'react-navigation'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ddcjosiahl/.npm/_logs/2019-02-08T13_18_47_333Z-debug.log
[08:18:47] Process exited with non-zero code: 1
[08:18:47] Set EXPO_DEBUG=true in your env to view the stack trace.

I am trying options with no luck:

  • Cleared NPM cache

  • Tried Yarn

  • Install expo cli again

  • npm install --save react-navigation ... react-native, native, etc

    npm install --save react-navigation npm ERR! code E404 npm ERR! 404 Not Found: @react-navigation/[email protected]

    • Note: I have spent all day yesterday trying to get new projects to work. I did manage to get passed it by installing different versions of react-native, and cannot replicate...which then caused a mismatch of versions and app wouldn't load:*

****RNGestureHandlerButton:**** enter image description here

Why is react-navigation@^3.0.0 needing [email protected] and how to solve?

Thanks!

4

4 Answers

0
votes

I had the same issue while upgrading from expo v31 to v32. Tried all what you have done with no luck. Finally, installing from github with npm install https://github.com/react-navigation/react-navigation-native solved the issue for me. I then installed react-navigation package separately and then all other required modules for my project.

3
votes

Solved by editing root .npmrc file confirming I had: registry=https://registry.npmjs.org/

My issue was related to having "_auth=".

Both npm and yarn now work with react-navigation and 404's I was getting. Thanks @Munishkin & @Atin Singh

0
votes

I don't have the clear idea to what your exact problem is. So, I am assuming that you're not able to use React-navigation with expo.

Try using yarn for the whole process instead of npm.

Use yarn when expo asks to make a new project and then to install react-navigation use-

yarn add react-navigation

I used navigation yesterday and it worked perfectly for me.

0
votes

This is weird, 'cause I just tried and it fetches react-navigation with all dependencies nicely. Actually if you load https://registry.npmjs.org/@react-navigation%2fnative url directly in your browser you should see the corresponding JSON schema. If it gives you 404 you might want to troubleshoot your DNS resolvers.