title: firebase serve: supervisorPort (5001) is already in use
body: <p>I built this <a href="https://github.com/YikSanChan/react-redux-todos" rel="nofollow noreferrer">React App</a>, that allows users to add todo item, and mark an item as completed/active. Todo items are stored in cloud firestore.</p>
  
  <p>I want to enable full-text search on the app, and one way is to create a cloud function that writes index to Algolia whenever cloud firestore witnesses a create operation.</p>
  
  <p>Inside my app root directory, I <a href="https://github.com/YikSanChan/react-redux-todos/commit/e1e228140c6aed0cc20b0025e8a25130a58b2cc8" rel="nofollow noreferrer">initialize cloud functions</a> and then <a href="https://github.com/YikSanChan/react-redux-todos/commit/afa3f7da61fd99fc7f9d3afa104ad7e7aa7cc49f" rel="nofollow noreferrer">implement the onTodoAdded function</a>. After done, I run <code>firebase serve</code> under <code>functions</code> directory and get the errors:</p>
  
  <pre><code>=== Serving from '/Users/evan/source/react-redux-todos'...
  
  i  functions: Preparing to emulate functions.
  Warning: You're using Node.js v10.6.0 but Google Cloud Functions only supports v6.11.5.
  i  hosting: Serving hosting files from: build
  ✔  hosting: Local server: http://localhost:5000
  error: SUPERVISOR error Error: listen EADDRINUSE 127.0.0.1:5001
      at Server.setupListenHandle [as _listen2] (net.js:1335:14)
      at listenInCluster (net.js:1383:12)
      at GetAddrInfoReqWrap.doListen [as callback] (net.js:1509:7)
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10)
  error: supervisorPort (5001) is already in use
  i  functions: No HTTPS functions found. Use firebase functions:shell if you would like to emulate other types of functions.
  </code></pre>
  
  <p>For a complete debug log, find <a href="https://gist.github.com/YikSanChan/773764a6db616598a6111830ef5ea42b" rel="nofollow noreferrer">here</a>.</p>
  
  <p>However, this command works fine: <code>firebase serve --only functions</code>.</p>
  
  <pre><code>=== Serving from '/Users/evan/source/react-redux-todos'...
  
  i  functions: Preparing to emulate functions.
  Warning: You're using Node.js v10.6.0 but Google Cloud Functions only supports v6.11.5.
  i  functions: No HTTPS functions found. Use firebase functions:shell if you would like to emulate other types of functions.
  </code></pre>
  
  <p>Since it says supervisorPort(5001) is already in use, I <code>lsof -i:5001</code> and finds no process. I also shut down my laptop and restart, gets the same error.</p>
  
  <p>I find the similar issue <a href="https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/173#issuecomment-407428310" rel="nofollow noreferrer">here</a>, however didn't find the solution.</p>