Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After installing 'react-navigation' The development server returned response code:500

I am beginner in react-native and I am getting below error, when I install and try to use react-navigation import {StackNavigator} from 'react-navigation'; I have tried a lot of link to resolve this but didn't find any solution. Below are the links:

Unable to resolve 'react-navigation'

https://github.com/react-community/react-navigation/issues/1846

https://github.com/facebook/react-native/issues/4968/

enter image description here

Please help me resolve the issue. Thanks in advance.

like image 874
Deepak Sachdeva Avatar asked Sep 01 '17 07:09

Deepak Sachdeva


1 Answers

Try this Working for me

npm install @react-navigation/native @react-navigation/stack

Import like this

import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';

OR

Please make sure you are not getting any error in your terminal like this

Error: Unable to resolve module `**modules_name**` from `node_modules\

that can be the cause of that.

if you are getting please follow the command

 npm install modules_name

for every module

Thanks

like image 73
Parveen Chauhan Avatar answered Oct 24 '22 06:10

Parveen Chauhan