Cannot resolve 'react-native'

I am trying to import react-native module into my react app. When I start my app server using 'npm start', I get the following error :

Module not found: Can't resolve 'react-native'

I have done following steps:

  • cleaned npm cache using 'npm cache verify'
  • deleted node_modules
  • rerun the command 'npm install'
  • checked package.json file if it has react-native dependency listed

Nothing worked for me. Please help!!

Try to recreate your app using the react native CLI. Use the command npm install -g react-native-cli, then use react-native init ProjectName and after that try to run the project.

If you cannot create a new app for any reason, try to install the react-native-cli anyway and try to run react-native run-android or react-native run-ios (depending on the plataform you want to use as a tester_ instead of npm start.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue