title: What is the role of Node.js in React-Native?
body: <p>I'm trying to understand the development process of React-Native, so I've found information about Metro, And then I've read/watch this <a href="https://www.youtube.com/watch?v=99QyAz3Wfqc" rel="noreferrer">Metro</a> video): </p>
  
  <blockquote>
    <p>Metro is the development platform for React Native and it does that by
    exposing an <strong>HTTP server</strong> so clients, in this case, emulators can
    communicate with it and it also exposes a <strong>Websocket server</strong> so it can
    push updates into the clients.</p>
  </blockquote>
  
  <p>The docs talk about the "React Native Packager" (now called Metro, according to the video) which runs on port 8081, so that is the HTTP server that starts when we type react-native run-android for example?</p>
  
  <p>Regarding the Websocket I still need to <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications" rel="noreferrer">read more</a>.</p>
  
  <p>The documentation says we're running our JavaScript code in two environments, depending if we're in debug mode or not, which I understood. But this <a href="https://ruoyusun.com/2015/11/01/things-i-wish-i-were-told-about-react-native.html" rel="noreferrer">article</a> confused me a little bit, says:</p>
  
  <blockquote>
    <p><strong>No. 4 You Code Does Not Run on Node.JS</strong>: The JavaScript runtime you’ve got is ether JavaScriptCore (non-debug) or V8 (debug). Even
    though you can use NPM and a node server is running on the background,
    your code does not actually run on Node.JS. So you won’t be able to
    use of the Node.JS packages. A typical example is jsonwebtoken, which
    uses NodeJS’s crypto module.</p>
  </blockquote>
  
  <p>And, then I've read things like:</p>
  
  <blockquote>
    <p>React Native uses Node.js, a JavaScript runtime, to build your
    JavaScript code.</p>
    
    <p>Node.js is a server-side JavaScript runtime environment. React
    Native ships with some tools that are written for Node.js.</p>
    
    <p>Node.js is an open source platform built on Chrome's JavaScript
    runtime; it offers a way to easily build fast, scalable
    programs. Node.js allows you to run JavaScript in Terminal, and helps
    create modules.</p>
  </blockquote>
  
  <p>In this <a href="https://developer.ibm.com/articles/dissecting-react-native/" rel="noreferrer">article</a>, it says:</p>
  
  <blockquote>
    <p>Download node.js from nodejs.org. This JavaScript runtime gives you
    access to npm, which is a convenient tool created by the node.js
    project that you can use to manage open source packages. Make sure
    that you download the latest LTS (Long Term Support) version of
    node.js. <strong>Also included with this download is a development server
    called the Metro bundler, which provides live updates when debugging.</strong></p>
  </blockquote>
  
  <p>So:</p>
  
  <ul>
  <li>The role of Node.js in RN is to only access npm and manage the packages? and is Metro is includes in Node.js? Am I missing/confusing something? Thank you.</li>
  </ul>