title: Error "document is not defined" when executing electron
body: <p>I would like to create an app by using Electron with a tiny html and js scripts and d3.js library.</p>
  
  <p>package.json</p>
  
  <pre><code>{
    "name": "Test_Report9",
  "version": "1.0.0",
  "main": "report9.js",
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "jsdom": "9.12.0"
  }
  </code></pre>
  
  <p>JavaScript(report9.js)</p>
  
  <pre><code>const d3 = require('d3');
  svg = d3.select("div").append("svg")
      .attr("id", "chart")
      .attr("width", WIDTH)
      .attr("height", HEIGHT);
  </code></pre>
  
  <p>With them, when executing the electron ($ electron path), an error message "document is not defined" is displayed.</p>
  
  <pre><code>App threw an error during load
  ReferenceError: document is not defined
      at Object.select (/Users/hnishim/node_modules/d3-selection/build/d3-selection.js:925:25)
      at Object.&lt;anonymous&gt; (/Users/hnishim/Documents/MOLCURE/Electron/Test_Report9_3/src/report9.js:11:10)
      at Object.&lt;anonymous&gt; (/Users/hnishim/Documents/MOLCURE/Electron/Test_Report9_3/src/report9.js:426:3)
      at Module._compile (module.js:571:32)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:488:32)
      at tryModuleLoad (module.js:447:12)
      at Function.Module._load (module.js:439:3)
      at loadApplicationPackage (/usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:283:12)
      at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:325:5)
  </code></pre>
  
  <p>Does anyone know the reason and how to solve it?</p>