Professional Documents
Culture Documents
IntelliJ React Native TypeError Cli - Init Is Not A Function
IntelliJ React Native TypeError Cli - Init Is Not A Function
This problem occurs when the globally installed packages react-native and
react-native-cli are outdated, as mentioned here.
However, the issue does not seem to be resolved when instantiating a new React
Native project through IntelliJ IDEA or IntelliJ Brainstorm. The solution to this would
be to run the below command while creating a new project.
This solution works but is not recommended as the latest React Native version
currently is 0.73.6 and the effort required to upgrade to the latest version is quite
high.
The changes required to upgrade RN from 0.68.2 to 0.73.6 can be found here.
Please follow the below steps, to successfully create and run a RN project in IntelliJ
IDEA.
Creating a new React Native project in IntelliJ IDEA:
1. Click on File -> New -> Project or Click on New Project button on the welcome
screen
2. Provide a name for your new RN project
3. Select React Native button in the Project Type field
4. In the React Native text field, modify the command to npx --package
@react-native-community/cli react-native
5. Click on Create button