electron/rebuild

node-canvas error: node-gyp failed to rebuild. Error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'

GitMurf opened this issue · 5 comments

I am struggling to get electron-rebuild to work for node-canvas. Anyone have any ideas or starting point troubleshooting steps? Thanks!

I am using newest version of node.js LTS for windows 11 and newest version of node-canvas.

FDC4E68F-D3B1-4E4A-AC14-F0233FA906DE

I have the same issue, but when trying to compile midi. Using electron-rebuild@3.2.9, targeting electron@21.2.3.

I had no issues before when using electron-rebuild@3.2.7, targeting electron@15.3.5.

Building module: midi, Completed: 1Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
⠙ Building module: midi, Completed: 1  RtMidi.cpp
⠹ Building module: midi, Completed: 1  input.cpp
⠧ Building module: midi, Completed: 1c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-internal.h(471): error C2429: language feature 'terse static assert'
requires compiler flag '/std:c++17'
[C:\myAppPath\node_modules\midi\build\midi.vcxproj]
c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-internal.h(472): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\myAppPath\node_modules\midi\build\midi.vcxproj]
c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-internal.h(655): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\myAppPath\node_modules\midi\build\midi.vcxproj]
c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-internal.h(656): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\myAppPath\node_modules\midi\build\midi.vcxproj]
c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-internal.h(657): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\myAppPath\node_modules\midi\build\midi.vcxproj]
⠏ Building module: midi, Completed: 1c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-callbacks.h(331): error C2062: type 'int' unexpected [C:\myAppPath\node_modules\midi\build\midi.
vcxproj]
c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-isolate.h(1531): error C2061: syntax error: identifier 'WasmDynamicTieringEnabledCallback' [C:\git\myAppPath\node_modules\midi\build\midi.vcxproj]
c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-wasm.h(192): warning C4996: 'v8::WasmStreaming::Client': Use SetMoreFunctionsCanBeSerializedCallback [C:\myAppPath\node_modules\midi\build\midi.vcxproj]
  c:\users\myUser\.electron-gyp\21.2.3\include\node\v8-wasm.h(137): note: see declaration of 'v8::WasmStreaming::Client'
⠋ Building module: midi, Completed: 1c:\myAppPath\node_modules\midi\src\input.cpp(91): warning C4996: 'Nan::Callback::Call': was declared deprecated
[C:\myAppPath\node_modules\
midi\build\midi.vcxproj]
  c:\myAppPath\node_modules\nan\nan.h(1724): note: see declaration of 'Nan::Callback::Call'
✖ Rebuild Failed

is there any progress ?

is there any progress ?

Unfortunately there is not. The ultimate solution is porting node-canvas from NaN to N-API. I am currently trying to get this done but have no experience in the c/c++ world so it is a long process for me but I am hopeful will get together a node-canvas fork using Node-API that will work with Electron in the next couple weeks :) I will make sure to post details here and hopefully eventually the node-canvas team will allow for a PR to integrate officially.

See the following:

The best solution is to upgrade to the latest version, including Electron, and most importantly to configure the build environment for 'node-gyp'
can refer to: https://stackoverflow.com/questions/57541402/node-gyp-configure-got-gyp-err-find-vs

This can now be closed with 🎉 Automattic/node-canvas#2235