nan icon indicating copy to clipboard operation
nan copied to clipboard

v2.13.0 broke electron-rebuild

Open gagarin55 opened this issue 6 years ago • 3 comments

Latest release has broken our build process.

node -v v8.15.0 node-gyp -v v3.8.0

An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  addon.cc
  win_delay_load_hook.cc
c:\projects\emerald-wallet\packages\desktop\node_modules\nan\nan_converters_43_inl.h(60): error C2664: 'bool v8::Value::BooleanValue(void) const': cannot convert argument 1 from 'v8::Isolate *' to 'v8::Local<v8::Context>' (compiling source file ..\src\addon.cc) [C:\projects\emerald-wallet\packages\desktop\node_modules\keccak\build\keccak.vcxproj]
  c:\projects\emerald-wallet\packages\desktop\node_modules\nan\nan_converters_43_inl.h(60): note: No constructor could take the source type, or constructor overload resolution was ambiguous (compiling source file ..\src\addon.cc)
gyp ERR! build error 
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\projects\emerald-wallet\packages\desktop\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\projects\\emerald-wallet\\packages\\desktop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=4.0.5" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\projects\emerald-wallet\packages\desktop\node_modules\keccak
gyp ERR! node -v v8.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Failed with exit code: 1
Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  addon.cc
  win_delay_load_hook.cc
c:\projects\emerald-wallet\packages\desktop\node_modules\nan\nan_converters_43_inl.h(60): error C2664: 'bool v8::Value::BooleanValue(void) const': cannot convert argument 1 from 'v8::Isolate *' to 'v8::Local<v8::Context>' (compiling source file ..\src\addon.cc) [C:\projects\emerald-wallet\packages\desktop\node_modules\keccak\build\keccak.vcxproj]
  c:\projects\emerald-wallet\packages\desktop\node_modules\nan\nan_converters_43_inl.h(60): note: No constructor could take the source type, or constructor overload resolution was ambiguous (compiling source file ..\src\addon.cc)
gyp ERR! build error 
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\projects\emerald-wallet\packages\desktop\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\projects\\emerald-wallet\\packages\\desktop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=4.0.5" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\projects\emerald-wallet\packages\desktop\node_modules\keccak
gyp ERR! node -v v8.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

On Windows - https://ci.appveyor.com/project/etcdevteam/emerald-wallet/builds/23066344 On Mac OSX - https://circleci.com/gh/ETCDEVTeam/emerald-wallet/884?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Thank you for assistance.

gagarin55 avatar Mar 14 '19 13:03 gagarin55

Seems this is caused by electron is using NODE_MODULE_VERSION 69 now which lets NAN think that it's newer then Node.JS 11 which uses 67 but actually electron 4.0.5 is more like Node.JS 10.

Looks like it's no longer true that a higher NODE_MODULE_VERSION indicates a newer release. There are a lot checks like #if NODE_MODULE_VERSION <= NODE_11_0_MODULE_VERSION in NAN...

Refs: https://github.com/electron/node/commit/8bc5d171a0873c0ba49f9433798bc8b67399788c

Flarna avatar Mar 14 '19 15:03 Flarna

see #840

Flarna avatar Mar 14 '19 19:03 Flarna

I had this issue as well on MacOS using Electron 4.0.4. My temporary workaround is to pin [email protected] until it gets resolved.

pfrazee avatar Mar 14 '19 20:03 pfrazee