Search code examples
reactjsreact-native

React native init error cannot find module-> node_modules\react-native\package.json'


So, when i try to create a new project using -> react-native init abc. Everything goes well until it says it cannot find package json. And then it ends up only having package json in the new abc folder.

Appreciate any help thanks.

Command Prompt Error 1 Command Prompt Error 1 Command Prompt Error 2
Command Prompt Error 2


Solution

  • Try reinstalling the node modules again. Go to the root directory of the project and remove the current node modules and install again.

    These are the commands : sudo rm -rf node_modules && npm install