code: def _check_react_prerequisites() -> None:
      """Args are for test purposes only."""
      missing_msgs = []
      version_regex = r"\d{1,2}\.\d{1,2}\.\d{1,3}"
  
      logger.info("Checking pre-requisites for react")
  
      # make sure npm is installed
      npm_version = subprocess.check_output(["npm", "--version"])
      has_npm = bool(re.search(version_regex, str(npm_version)))
      npm_version = re.search(version_regex, str(npm_version))
      npm_version = (
          None if npm_version is None else npm_version.group(0)
      )
  
      if not has_npm:
          m = """
          This machine is missing 'npm'. Please install npm and rerun 'lightning init react-ui' again.
  
          Install instructions: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
          """
          missing_msgs.append(m)
  
      # make sure node is installed
      node_version = subprocess.check_output(["node", "--version"])
      has_node = bool(re.search(version_regex, str(node_version)))
      node_version = re.search(version_regex, str(node_version))
      node_version = (
          None if node_version is None else node_version.group(0)
      )
  
      if not has_node:
          m = """
          This machine is missing 'node'. Please install node and rerun 'lightning init react-ui' again.
  
          Install instructions: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
          """
          missing_msgs.append(m)
  
      # make sure yarn is installed
      yarn_version = subprocess.check_output(["yarn", "--version"])
      has_yarn = bool(re.search(version_regex, str(yarn_version)))
      yarn_version = re.search(version_regex, str(yarn_version))
      yarn_version = (
          None if yarn_version is None else yarn_version.group(0)
      )
  
      if not has_yarn:
          m = """
          This machine is missing 'yarn'. Please install npm+node first, then run
  
          npm install --global yarn
  
          Full install instructions: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable
          """
          missing_msgs.append(m)
  
      # exit or show success message
      if len(missing_msgs) > 0:
          missing_msg = "\n".join(missing_msgs)
          raise SystemExit(missing_msg)
      logger.info(
          f"""
      found npm  version: {npm_version}
      found node version: {node_version}
      found yarn version: {yarn_version}
  
      Pre-requisites met!
      """
      )
  
file_path: pytorch-lightning/src/lightning/app/cli/cmd_react_ui_init.py
imports: import os
  import re
  import shutil
  import subprocess
  from typing import Optional
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 3 for calling a global function with example usage: _check_react_prerequisites() without return types