React Native continues to be a top choice for building cross-platform mobile applications with JavaScript and React. However, the process of initializing a new React Native app has changed — and if you’re using older commands, you may face errors related to deprecated tools and conflicting dependencies.
This guide walks you through the correct and recommended way to initialize a React Native app called TestApp in 2025.
โ The Old (Broken) Way
You might try this out of habit:
npx react-native init TestApp
But you'll likely see warnings or errors such as:
-
The init command is deprecated.
-
npm ERR! ERESOLVE could not resolve
-
Dependency conflicts between
react-native
andreact
Why? Because:
-
The
init
command inreact-native
is now deprecated. -
npx
may pull a cached or incompatible version. -
Dependency mismatches between React Native and its required React version cause installation failures.
โ The Correct Way in 2025
Use the official community CLI instead:
npx @react-native-community/cli init TestApp
This ensures:
-
You’re using the up-to-date CLI tooling.
-
You can specify a stable and compatible React Native version.
-
You avoid
npm
dependency resolution issues.
๐ Official Docs: https://reactnative.dev/docs/getting-started
๐งผ Optional Cleanup Step (If You Get Errors)
If you’ve seen repeated dependency issues, run:
npm cache clean --force
By following this updated method, you'll get your TestApp project up and running without the version conflicts or deprecated warnings that trip up many developers in 2025.