title: Electron Browser Window won't open
body: <p>When I am executing npm command npm start it shows only this not opening an electron browser window.</p>
  
  <blockquote>
    <p>firstdesktopapp@1.0.0 start E:\NodeJS Projects\ElectronJs\FirstDesktopAPp</p>
    
    <p>electron .</p>
  </blockquote>
  
  <p>here is my package.json code</p>
  
  <pre><code>{
    "name": "firstdesktopapp",
    "version": "1.0.0",
    "description": "First Desktop App on Electron",
    "main": "app.js",
    "scripts": {
      "start": "electron ."
   },
   "author": "Makhmoor Rehman",
   "license": "NoN",
   "devDependencies": {
          "electron": "^4.0.0-nightly.20181010"
   }
  }
  </code></pre>
  
  <p>and here is my app.js code</p>
  
  <pre><code>const electron = require("electron");
  const url = require("url");
  const path = require("path");
  
  const {app, BrowserWindow} = electron;
  
  let mainWindow;
  
  // Listen for app to be ready
  app.on("ready", function() {
      // Create new window
      mainWindow = new BrowserWindow({});
  
      //load html into window
      mainWindow.loadURL(url.format({
          pathname: path.join(__dirname, "index.html"),
          protocol: "file:",
          slashes: true,
      }));
  
  });
  </code></pre>
  
  <p>I have installed the latest version of electron and nodejs, I have a dell laptop and os Windows 10 64bit.</p>
  
  <p>After killing the process of electron I am getting this.</p>
  
  <blockquote>
    <p>npm ERR! code ELIFECYCLE</p>
    
    <p>npm ERR! errno 1</p>
    
    <p>npm ERR! firstdesktopapp@1.0.0 start: <code>electron .</code></p>
    
    <p>npm ERR! Exit status 1</p>
    
    <p>npm ERR!</p>
    
    <p>npm ERR! Failed at the firstdesktopapp@1.0.0 start script.</p>
    
    <p>npm ERR! This is probably not a problem with npm. There is likely additional </p>
    
    <p>logging output ab             ove.</p>
    
    <p>npm ERR! A complete log of this run can be found in:</p>
    
    <p>npm ERR!     C:\Users\makhm\AppData\Roaming\npm-cache_logs\2018-10-31T01_10_09_481Z-debug.log</p>
  </blockquote>
  
  <p>And in the <strong>debug</strong> file I am getting this</p>
  
  <p>nfo it worked if it ends with ok</p>
  
  <p>1 verbose cli [ 'E:\nodejs\node.exe',</p>
  
  <p>1 verbose cli   'E:\nodejs\node_modules\npm\bin\npm-cli.js',</p>
  
  <p>1 verbose cli   'start' ]</p>
  
  <p>2 info using npm@6.4.1</p>
  
  <p>3 info using node@v11.0.0</p>
  
  <p>4 verbose run-script [ 'prestart', 'start', 'poststart' ]</p>
  
  <p>5 info lifecycle firstdesktopapp@1.0.0~prestart: firstdesktopapp@1.0.0</p>
  
  <p>6 info lifecycle firstdesktopapp@1.0.0~start: firstdesktopapp@1.0.0</p>
  
  <p>7 verbose lifecycle firstdesktopapp@1.0.0~start: unsafe-perm in lifecycle true</p>
  
  <p>8 verbose lifecycle firstdesktopapp@1.0.0~start: PATH: 
  E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\NodeJS Projects\ElectronJs\FirstDesktopAPp\node_modules.bin;C:\Users\makhm\bin;E:\Git\mingw64\bin;E:\Git\usr\local\bin;E:\Git\usr\bin;E:\Git\usr\bin;E:\Git\mingw64\bin;E:\Git\usr\bin;C:\Users\makhm\bin;C:\Python27;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\SYSTEM32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\SKYPE\PHONE;C:\xampp\php;F:\PuTTY;C:\xamppp\php;C:\ProgramData\ComposerSetup\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files (x86)\Yarn\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Microsoft VS Code\bin;E:\Git\cmd;E:\nodejs;C:\Users\makhm\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\makhm\AppData\Roaming\Composer\vendor\bin;C:\Users\makhm\AppData\Local\Yarn\bin;C:\Users\makhm\AppData\Roaming\npm;E:\Git\usr\bin\vendor_perl;E:\Git\usr\bin\core_perl</p>
  
  <p>9 verbose lifecycle firstdesktopapp@1.0.0~start: CWD: E:\NodeJS Projects\ElectronJs\FirstDesktopAPp</p>
  
  <p>10 silly lifecycle firstdesktopapp@1.0.0~start: Args: [ '/d /s /c', 'electron .' ]</p>
  
  <p>11 silly lifecycle firstdesktopapp@1.0.0~start: Returned: code: 1  signal: null</p>
  
  <p>12 info lifecycle firstdesktopapp@1.0.0~start: Failed to exec start script</p>
  
  <p>13 verbose stack Error: firstdesktopapp@1.0.0 start: <code>electron .</code></p>
  
  <p>13 verbose stack Exit status 1</p>
  
  <p>13 verbose stack     at EventEmitter. (E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)</p>
  
  <p>13 verbose stack     at EventEmitter.emit (events.js:182:13)</p>
  
  <p>13 verbose stack     at ChildProcess. (E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)</p>
  
  <p>13 verbose stack     at ChildProcess.emit (events.js:182:13)</p>
  
  <p>13 verbose stack     at maybeClose (internal/child_process.js:962:16)</p>
  
  <p>13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)</p>
  
  <p>14 verbose pkgid firstdesktopapp@1.0.0</p>
  
  <p>15 verbose cwd E:\NodeJS Projects\ElectronJs\FirstDesktopAPp</p>
  
  <p>16 verbose Windows_NT 10.0.17134</p>
  
  <p>17 verbose argv "E:\nodejs\node.exe" "E:\nodejs\node_modules\npm\bin\npm-cli.js" "start"</p>
  
  <p>18 verbose node v11.0.0</p>
  
  <p>19 verbose npm  v6.4.1</p>
  
  <p>20 error code ELIFECYCLE</p>
  
  <p>21 error errno 1</p>
  
  <p>22 error firstdesktopapp@1.0.0 start: <code>electron .</code></p>
  
  <p>22 error Exit status 1</p>
  
  <p>23 error Failed at the firstdesktopapp@1.0.0 start script.</p>
  
  <p>23 error This is probably not a problem with npm. There is likely additional logging output above.</p>
  
  <p>24 verbose exit [ 1, true ]</p>
  
  <p>"</p>