Skip to content

Error: node-gyp failed to rebuild 'xxxxx/@serialport\bindings-cpp' #199

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

Closed
07ke opened this issue Jan 2, 2025 · 6 comments · May be fixed by #210
Closed

Error: node-gyp failed to rebuild 'xxxxx/@serialport\bindings-cpp' #199

07ke opened this issue Jan 2, 2025 · 6 comments · May be fixed by #210

Comments

@07ke
Copy link

07ke commented Jan 2, 2025

SerialPort Bindings Version

13.0.0

Node Version

v22.2.0

Electron Version

33.2.1

Platform

Microsoft Windows NT 10.0.26100.0 x64

Architecture

x64

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

npm install

What happens?

electron-builder install-app-deps

• electron-builder version=25.1.8
• executing @electron/rebuild electronVersion=33.2.1 arch=x64 buildFromSource=false appDir=./
• installing native dependencies arch=x64
• preparing moduleName=@serialport/bindings-cpp arch=x64
⨯ (node:16496) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.
(Use node --trace-deprecation ... to show where the warning was created)

serialport.cpp
C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(125,67): warning C4003: 类函数宏的调用“max”参数不足 [D:\new\gbk_electron\node_modules@serialport\bindings-cpp\build\bindings.vcxproj]
(编译源文件“../src/serialport.cpp”)

C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(139,66): warning C4003: 类函数宏的调用“max”参数不足 [D:\new\gbk_electron\node_modules@serialport\bindings-cpp\build\bindings.vcxproj]
(编译源文件“../src/serialport.cpp”)

C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(125,67): error C2589: “(”:“::”右边的非法标记 [D:\new\gbk_electron\node_modules@serialport\bindings-cpp\build\bindings.vcxproj]
(编译源文件“../src/serialport.cpp”)
C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(124,35):
此诊断出现在编译器生成的函数“bool v8::internal::SmiTagging<4>::IsValidSmi(T)”中

C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(125,67): error C2760: 语法错误: 此处出现意外的“)”;应为“表达式” [D:\new\gbk_electron\node_modules@serialport\bindings-cpp\build\bindings.vcxproj]
(编译源文件“../src/serialport.cpp”)
C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(124,35):
此诊断出现在编译器生成的函数“bool v8::internal::SmiTagging<4>::IsValidSmi(T)”中

C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(125,67): error C2760: 语法错误: 此处出现意外的“)”;应为“;” [D:\new\gbk_electron\node_modules@serialport\bindings-cpp\build\bindings.vcxproj]
(编译源文件“../src/serialport.cpp”)
C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(124,35):
此诊断出现在编译器生成的函数“bool v8::internal::SmiTagging<4>::IsValidSmi(T)”中

C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(125,67): error C3878: 语法错误:“expression-statement”后出现意外标记“)” [D:\new\gbk_electron\node_modules@serialport\bindings-cpp\build\bindings.vcxproj]
(编译源文件“../src/serialport.cpp”)
C:\Users\86132.electron-gyp\33.2.1\include\node\v8-internal.h(124,35):
此诊断出现在编译器生成的函数“bool v8::internal::SmiTagging<4>::IsValidSmi(T)”中

What should have happened?

Additional information

No response

@artus9033
Copy link
Contributor

artus9033 commented Jan 7, 2025

+1, this issue is also reproducible in my project using [email protected]. After checking, serialport@^12.0.0 compiles fine, so the problem is only relevant to v13.

@gee1k
Copy link

gee1k commented Jan 15, 2025

+1

@rotu
Copy link
Contributor

rotu commented Feb 27, 2025

I think this is fixed by #208. Not sure why it broke in the first place, though.

@pabtab
Copy link

pabtab commented Feb 28, 2025

Facing the same issue, and downgraded from v13 to v12 as @artus9033 said, and it worked.

@Yuyuko9961
Copy link

same error +1
Triggered when node-Gyp was working on the following two files
.electron-gyp\34.3.0\include\node\v8-internal.h(173,51)
.electron-gyp\34.3.0\include\node\v8-function-callback.h(461,61)
both of which are syntax errors

@alexpargon
Copy link

alexpargon commented Mar 13, 2025

same error +1 Triggered when node-Gyp was working on the following two files .electron-gyp\34.3.0\include\node\v8-internal.h(173,51) .electron-gyp\34.3.0\include\node\v8-function-callback.h(461,61) both of which are syntax errors

Having the same error right now, and I was pushed to upgrade due to incompatibility issues of the old process with the newer CPP version installed on the ubuntu machines that github actions provide, so I cannot go back, do you know any way around this issue?

issue when compiling v12 with node 20 and 22

› make: Entering directory '/home/runner/work/Bazecor/Bazecor/node_modules/@serialport/bindings-cpp/build'
›   g++ -o Release/obj.target/bindings/src/serialport.o ../src/serialport.cpp '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMP
› RESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_ENABLE_SANDBOX' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DNAPI_CPP_EXCEPTIONS' '-DBUILDING_NODE_EXTENSION' -I/home/runner/.electron-gyp/34.2.0/include/node -I/home/runner/.electron-gyp/34.2.0/src -I/home/runner/.electron-gyp/34.2.0/deps/openssl/config -I/home/runner/.electron-gyp/34.2.0/deps/openssl/openssl/include -I/home/runner/.electron-gyp/34.2.0/deps/uv/include -I/home/runner/.electron-gyp/34.2.0/deps/zlib -I/home/runner/.electron-gyp/34.2.0/deps/v8/include -I../node_modules/node-addon-api  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++20 -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport.o.d.raw   -c
› g++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’?

alexpargon added a commit to Dygmalab/bindings-cpp that referenced this issue Mar 21, 2025
When building Bazecor with @serialport/bindincs-cpp, an error happens on windows (same as this one : prebuild/node-gyp-build#70), also commented on serialport#199
@07ke 07ke closed this as completed Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

7 participants