title: Running NodeJS from Python
body: <p>I'm having a tough time figuring out how to run NodeJS from Python. I have no problems running ShellScript from Python and NodeJS from ShellScript, but can't seem to get NodeJS from Python, I just get the following output:</p>
  <pre><code>b&quot;
  </code></pre>
  <p>These are the simplified version of my scripts.</p>
  <p>NodeJS I am trying to run from within Python.</p>
  <pre><code>#!/usr/bin/env node
  console.log(&quot;Hello &quot; + process.argv[2]);
  </code></pre>
  <p>And here is the Python, using Python3.</p>
  <pre><code>from datetime import datetime
  import json
  import os
  import re
  import sys
  import subprocess
  
  if __name__ == '__main__':
          p = subprocess.Popen(['/Users/Brett/scripts/hello.js', 'Brett'], stdout=subprocess.PIPE)
          out = p.stdout.read()
          print(out)
          
  </code></pre>
  <p>Thanks for the help! Much appreciated.</p>
  <p>EDITS:
  I have no issue executing the following from the commandline, as 'hello.js' is executable:</p>
  <pre><code>hello.js 'Brett'
  </code></pre>
  <p><code>shell=true</code> does not fix it.</p>
  <p>Additionally, I am on macOS Catalina 10.15.5 and therefore my shell is zsh.</p>
  <p>If I add <code>node</code> to the front of the command, I get no such file or directory for <code>node</code>, I tried it as follows:
  <code>p = subprocess.Popen(['/Users/Brett/scripts/hello.js', 'Brett'], stdout=subprocess.PIPE)</code></p>