title: Working with NodeJs serialPort - Error: %1 is not a valid Win32 application
body: <p>I am trying to get serialport (<a href="https://www.npmjs.com/package/serialport" rel="nofollow">https://www.npmjs.com/package/serialport</a>) to work on windows so that I can send commands to my serial port and hence open/close the lock.  </p>
  
  <p>The serialport was installed via bash.</p>
  
  <pre><code>npm install serialport --save-dev
  </code></pre>
  
  <p>Below is the error</p>
  
  <pre><code>C:\Users\[...]\electron-with-express\express-app\node_modules\bindings\bindings.js:83
  
  Error: %1 is not a valid Win32 application.
  </code></pre>
  
  <p>Below is the page</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var SerialPort = require('serialport');
  
  // check which port is available
  //var sp = require('../');
  
  
  /* GET home page */
  router.get('/', function(request, response){
  
      //sp.list(function(err, ports) {
   // console.log(ports);
  //});
  
   SerialPort.list(function (err, ports) {
    ports.forEach(function(port) {
      console.log(port.comName);
      console.log(port.pnpId);
      console.log(port.manufacturer);
    });
  });
  });
  
  // Important
  module.exports = router;
  </code></pre>
  
  <p>The NodeJs app is being run via Electron</p>