electron-userland/electron-webpack-quick-start

"serialport" package causes crash in dev mode

Opened this issue · 2 comments

Platform: Windows 10
Node: v10.16.0
Npm: 6.9.0
Yarn: 1.16.0

Hey! I've just freshly git cloned this repo and installed serialport": "^7.1.5.
Then I added these lines to src/main/index.js and after I run npm run dev node crashes without any error.

import SerialPort from 'serialport'

SerialPort.list()
  .then(ports => {
    console.log(ports)
  })
  .catch(error => {
    console.log(error)
  })

Here's output
Untitled

Could you give any advice?

Here's more descriptive output when I run npm run dist

C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\@serialport\bindings>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )

Error output:
prebuild-install ERR! Electron version 4.0.1 found - skipping prebuild-install work due to known ABI issue
prebuild-install ERR! More information about this issue can be found at https://github.com/lgeiger/node-abi/issues/54
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\@serialport\bindings
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@2.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@2.0.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Predator\AppData\Roaming\npm-cache\_logs\2019-06-02T10_47_49_591Z-debug.log

    at ChildProcess.childProcess.once.code (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\builder-util\src\util.ts:244:14)
    at Object.onceWrapper (events.js:286:20)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
From previous event:
    at _rebuild (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\util\yarn.ts:179:5)
    at rebuild (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\out\util\yarn.js:163:19)
    at C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\util\yarn.ts:20:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
From previous event:
    at _installOrRebuild (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\out\util\yarn.js:71:28)
    at installOrRebuild (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\out\util\yarn.js:55:28)
    at C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:511:13
    at Generator.next (<anonymous>)
From previous event:
    at Packager.installAppDependencies (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:472:70)
    at C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:420:20
    at Generator.next (<anonymous>)
From previous event:
    at Packager.doBuild (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:396:24)
    at C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:366:57
From previous event:
    at Packager._build (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:335:133)
    at C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:331:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
From previous event:
    at Packager.build (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\packager.ts:288:14)
    at build (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\app-builder-lib\src\index.ts:59:28)
    at build (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\electron-builder\src\builder.ts:227:10)
    at then (C:\Users\Predator\Desktop\dev\JS\electron-webpack-quick-start\node_modules\electron-builder\src\cli\cli.ts:46:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron-webpack-quick-start@0.0.0 dist: `yarn compile && electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-webpack-quick-start@0.0.0 dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Predator\AppData\Roaming\npm-cache\_logs\2019-06-02T10_47_49_644Z-debug.log

Using this stackoverflow answer I've managed to make everything work