Environment
- VS Code: 1.114.0
- Extension: wmerkens.vscode-circuitpython-v2 v0.3.4
- OS: Windows 11
Description
The extension fails to activate on Windows with:
Error: bindings.node is not a valid Win32 application.
The build/Release/bindings.node inside serialport/node_modules/@serialport/bindings-cpp is
a macOS-compiled binary. The Windows prebuild is included in the extension at
prebuilds/win32-x64/@serialport+bindings-cpp.node but node-gyp-build doesn't pick it up
because build/Release/bindings.node already exists and takes precedence.
Workaround (until fixed)
Replace the bad binary with the correct Windows prebuild manually:
$ext = "C:\Users\<YOU>\.vscode\extensions\wmerkens.vscode-circuitpython-v2-0.3.4\node_modules\serialport\node_modules\@serialport\bindings-cpp"
Copy-Item "$ext\build\Release\bindings.node" "$ext\build\Release\bindings.node.bak"
Copy-Item "$ext\prebuilds\win32-x64\@serialport+bindings-cpp.node" "$ext\build\Release\bindings.node"
Then reload the VS Code window.
Suggested fix:
Either remove build/Release/bindings.node from the packaged extension so node-gyp-build
falls through to the correct platform prebuild, or add a post-install/activation script that
selects the right prebuild at runtime.
Environment
Description
The extension fails to activate on Windows with:
Error: bindings.node is not a valid Win32 application.
The
build/Release/bindings.nodeinsideserialport/node_modules/@serialport/bindings-cppisa macOS-compiled binary. The Windows prebuild is included in the extension at
prebuilds/win32-x64/@serialport+bindings-cpp.nodebutnode-gyp-builddoesn't pick it upbecause
build/Release/bindings.nodealready exists and takes precedence.Workaround (until fixed)
Replace the bad binary with the correct Windows prebuild manually: