Error: Cannot find module ‘react-native/cli’

Andre Feri
1 min readAug 3, 2022
Lebih pusing mikirin error, daripada mikirin ayang

Just share my first experience facing issue that make me very confused about this issue, and not easy to find out the solution to resolve this issue.

I’ve came across to several website community, such as Github, StackOverflow. But, unfortunately i didn’t find the point of light about how to resolve this issue. The issue is came from outdated version of @react-native-community/cli-platform-android/native_modules.gradle, exactly one of them is caused by this line of code :

console.log(require('react-native/cli').bin)

The solution is very easy, you only need to install the latest version @react-native-community/cli-platform-android package.

Run this in your project :

npm i @react-native-community/cli-platform-android

And then re-run again your project after that the problem is clear :)

If you face the error on your react-native version 0.61.4, run this :

npm i @react-native-community/cli-platform-android@3.0.0-alpha.2

Happy Coding.

--

--