2

I was checking latest react native blog in which they introduced doctor command for react native.

the only thing i can understand from there is do envoirnment stuff for you. ?

But i don't understand the purpose.

What is exactly purpose of doctor command in react native ?

Muhammad Ashfaq
  • 2,359
  • 5
  • 20
  • 46

2 Answers2

4

The doctor command is available as a part of React Native 0.62.This command to help you out with getting started, troubleshooting and automatically fixing errors with your development environment. The doctor command is heavily inspired by Expo and Homebrew's own doctor command with a pinch of UI inspired by Jest.

Command

npx @react-native-community/cli doctor

This command checks your environment and displays a report of the status of react native installation. Check the output carefully for other software you might need to install. For example:-

enter image description here

What checks are currently supported

doctor currently supports the following checks:

  • Node.js (>= 8.3)
  • yarn (>= 1.10)
  • npm (>= 4)
  • Watchman (>= 4), used for watching changes in the filesystem when in development mode.

Specific to the Android environment:

  • Android SDK (>= 26), the software runtime for Android.
  • Android NDK (>= 19), the native development toolkit for Android.
  • ANDROID_HOME, environment variable required by the Android SDK setup.

And to the iOS environment

  • Xcode (>= 10), IDE for developing, building and shipping iOS applications.
  • CocoaPods, library dependency management tool for iOS applications.
  • ios-deploy (optional), library used internally by the CLI to install applications on a physical iOS device.

Please check following link for more detail

https://facebook.github.io/react-native/blog/2019/11/18/react-native-doctor

Vishal Dhanotiya
  • 2,512
  • 1
  • 13
  • 32
1

It is similar to flutter doctor. React native doctor command will fix any issue related to react-native in your project or pc. For example if you have not installed android studio, its packages or xcode necessary for running project, it will either suggest or automatically fix issues which will save hours of headache.

Samin
  • 275
  • 5
  • 13