1

What is the difference between the following:

npx react-native init MyNewProject

and

react-native init MyNewProject

Expo projects can be initiated using the following:

The difference between the two methods can be found here (differences between create-react-native-app and exp init)

create-react-native-app MyNewProject

expo init MyNewProject

Mohamed Daw
  • 71
  • 1
  • 6

1 Answers1

3

npx is a command which allows you to run commands inside an npm package without having to install it. npx react-native and react-native are the same commands, except that to call react-native you'd have to install it using npm first.

npm install react-native
Teymour
  • 1,832
  • 1
  • 13
  • 34
  • as [this reactnative.dev blog](https://reactnative.dev/docs/next/environment-setup#react-native-command-line-interface) states, "it recommends to use "npx react-native@latest init", If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues." I don't know why? – peter Jun 05 '23 at 08:33