Meet the new diagnostic tool for react-native : react-native doctor

Aravind Madhusudhanan Nair
2 min readNov 19, 2019

If you’ve been in to flutter for sometime, you may know the usage of flutter doctor command. If not, the doctor command checks your developer environment and displays a report of the status of your React Native setup and let you know what all to be done to make it work properly. It is used to diagnose if there are any platform dependencies that are pending to be completely setup.

Recently, a new command was launched as per the react-native community blog which performs the same as what flutter doctor does. As mentioned in the official blog post in react native community, it was inspired from Expo and Homebrew’s own doctor command with a pinch of UI inspired from Jest.

Working

The doctor command supports almost all the libraries associated with the react-native like the Cocoapods, Xcode , Android SDK etc. By using the doctor command, it will be easier for the developer to fix the issues with the development environment automatically. Even if doctor isn’t able to fix them automatically, you’ll be given proper links or guides so that you can fix it without hazzling over the internet.

How to use react-native doctor

The doctor command is a part of the react-native@0.62. If you are using and older version of react-native, you can try it without upgrading by running the command below from the project directory.

npx @react-native-community/cli doctor
Source: React Native Blog Post

Supported checks (as of now)

  • 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.
  • ios-deploy (optional), library used internally by the CLI to install applications on a physical iOS device.

EndNote

This is one useful command for developers to troubleshoot and fix issues in the development environment so that they can spend more time building apps, rather than fixing issues. Huge thanks to react-native community for working on this 🍻 !

Reference(s):

  1. React Native Blog Post

--

--

Aravind Madhusudhanan Nair

Writes about JS, React and React-Native development and other technology stuff.