I have this problem when I want to install React Navigation on Windows with npm
Then when I import the component
import {StackNavigator} from 'react-navigator'
When emulating in android I get the following error
You need to have the file package.json
. To create it you can use the following command:
$ npm init
Apparently on windows the package is not installed unless you have this file.
The problem is simple to compose.
import { StackNavigator } from 'react-navigation'
Change the part where you type react-navigator to react-navigation and it should work. For javascript you have to be very careful as it is case-sensitive and in this case you are making the import incorrect.