timfish / aurelia-electron-webpack

Aurelia Electron app built with Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not install on node 12

jsplate opened this issue · comments

I'm using node 12.14.1 on windows

yarn install fails with node-gyp at usb-detection module.

(xxx means the directory on my windows machine)

gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  detection.cpp
  deviceList.cpp
  detection_win.cpp
  win_delay_load_hook.cc
xxx\aurelia-electron-webpack\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 
'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [xxx\node_modules\usb-detection\build\detection.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
 xxx\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
xxx\node_modules\nan\nan_object_wrap.h(127): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [xxx\node_modules\usb-detection\build\detection.vcxproj]
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)
  xxx\node_modules\nan\nan.h(1920): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
          with
          [
              T=v8::Object
          ] (compiling source file ..\src\detection.cpp)

I found the project very interesting, there are not many projects with electron, ts, webpack AND aurelia of such a high quality...

I haven't updated this project in a while.

Node changes native API frequently and this can break native module compatibility. You should be able to fix this by updating usb-detection to the latest version (4.7.0).

If native modules migrate to N-API, the API is more stable and they can avoid this pain but I imagine modules not using this stable API will be around for a long time.

It's worth pointing out that you also have to consider the node version embedded in the version of Electron you will be shipping with your app. For the least amount of pain, I usually ensure that my locally installed node version matches the one in Electron.

I updated this significantly a few months ago and should all be working now.