Skip to content

[Bug] Extension ships macOS-compiled bindings.node — fails to activate on Windows #42

Description

@ross-satchell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions