title: Cannot read property 'join' of undefined in Javascript file Electron JS
body: <p>I have an application in Electron JS that is calling a python function to execute a python script.
  When the script executes it should send the data back to the Electron JS GUI and display it.</p>
  
  <p>The issue I am having is that it is saying that join is undefined:</p>
  
  <blockquote>
    <p>weather.js:9 Uncaught TypeError: Cannot read property 'join' of
    undefined
        at get_weather (weather.js:9)
        at HTMLButtonElement.onclick (weather.html:14)</p>
  </blockquote>
  
  <p>here is my JavaScript file:</p>
  
  <pre><code>let {PythonShell} = require('python-shell')
  var path = require("path")
  
  function get_weather() {
  
    var city = document.getElementById("city").value
  
    var options = {
      scriptPath : path.join(__dirname, '/../engine/'),
      args : [city]
    }
  
    let pyshell = new PythonShell('weatherApp.py', options);
  
  
    pyshell.on('message', function(message) {
      swal(message);
    })
    document.getElementById("city").value = "";
  }
  </code></pre>
  
  <p>The line "scriptPath : path.join(__dirname, '/../engine/')," seems to be the offending piece of code.</p>
  
  <p>My gui.html file is as follows:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta charset="UTF-8"&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
      &lt;h1&gt;Get your local weather ...&lt;/h1&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;label&gt;Enter city name here: &lt;label&gt;
      &lt;input id="city" type = "text" placeholder="City"&gt;
      &lt;button type = "button" value="clickme" onclick="get_weather()"&gt;Get Weather&lt;/button&gt;
      &lt;!--- &lt;button class="btn btn-success" onclick="get_weather();"&gt;Go!&lt;/button&gt; --&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;br&gt;
      &lt;script src="/home/ironmantis7x/Documents/BSSLLC/projects/node_electron/electronDemoApps/guiApp/gui/linkers/weather.js"&gt;&lt;/script&gt;
      &lt;p&gt;&lt;button type="button"&gt;&lt;a href="gui.html"&gt;Back to Main Page&lt;/a&gt;&lt;/button&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What error(s) do I need to fix to get this working correctly?</p>
  
  <p>Thank you.</p>