Mr. Mechanic
Mr. Mechanic

Reputation: 111

What is difference between "npx react-native run-android" vs "react-native run-android"

What is difference between npx react-native run-android vs react-native run-android

Upvotes: 11

Views: 1694

Answers (1)

LonelyCpp
LonelyCpp

Reputation: 2673

There are currently two CLIs:

  • @react-native-community/cli – the one used directly by react-native. That makes it a transitive dependency of your project.
  • react-native-cli – an optional global convenience package, which is a proxy to @react-native-community/cli and global installation helper.

The global version is no longer recommended

  • npx executes either from a local node_modules/.bin, or from a central cache, installing any packages needed in order for to run.
  • When you run npx ... it picks up the cli package that is part of your project dependency

Upvotes: 5

Related Questions