What’s the issue?
I want to connect Go to NodeJS using napi-go.
When I run go build -buildmode=c-shared -o "example.node" .
this is the error I get:
cgo: cannot parse $WORK/b046/_cgo_.o as ELF, Mach-O, PE or XCOFF
Expected
An “example.node” file should be created which can be required in the index.js
file.
Repository
Here is the small example repo I’m using where this error happens for me.
https://github.com/annie-elequin/napi-go-test