Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GitMurf opened this issue Nov 8, 2022 · 5 comments

Comments

@GitMurf
Copy link

GitMurf commented Nov 8, 2022

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

@nytamin
Copy link

nytamin commented Nov 16, 2022

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

@AutismPatient
Copy link

is there any progress ?

@GitMurf
Copy link
Author

GitMurf commented Dec 14, 2022

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:

@AutismPatient
Copy link

AutismPatient commented Feb 17, 2023

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

@GitMurf
Copy link
Author

GitMurf commented Sep 27, 2023

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

@GitMurf GitMurf closed this as completed Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants