2

Previously, when I had tried using react-native we were told to use react-native run-ios to run the project from the command line. Now, the instructions say to use npx react-native run-ios from the command line.

What in the benefit of using npx. Does using npx change how the project is compiled? If I sometimes use npx and sometimes neglect to use it will it mess anything up in my project?

kojow7
  • 10,308
  • 17
  • 80
  • 135

1 Answers1

1

Check this answer more about of npx


react-native supported and recommended to use npx start from react-native@0.60.0.

The benefit of using npx is don't need to install react-native-cli tools globally. Check the below example of using npx and not for the react-native project.

### Using npx ###
﹩ npx react-native init <SimpleProjectName>
### Without using npx ###
﹩ npm i -g react-native-cli
﹩ react-native init <SimpleProjectName>

Both react-native-cli and npx react-native are should not use in one project. The official docs said before starting a new project:

If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues.

lwinkyawmyat
  • 1,221
  • 1
  • 16
  • 34