grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

grpc-tools package does not work with M3 Pro Mac

Open Lukas-Kullmann opened this issue 1 year ago • 3 comments

Problem description

When I install grpc-tools and try to run code generation (i.e. node node_modules/.bin/grpc_tools_node_protoc [...]), I get an error

node_modules/.bin/grpc_tools_node_protoc [...]
node:internal/child_process:414
    throw errnoException(err, 'spawn');
    ^

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:414:11)
    at spawn (node:child_process:761:9)
    at execFile (node:child_process:351:17)
    at Object.<anonymous> ([..]/node_modules/grpc-tools/bin/protoc.js:39:21)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47 {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}

Node.js v18.18.2

I then tried to run the command that the protoc.js file generates directly

node_modules/grpc-tools/bin/protoc --plugin=protoc-gen-grpc=node_modules/grpc-tools/bin/grpc_node_plugin [...]

But that gives me a different error

zsh: bad CPU type in executable: node_modules/grpc-tools/bin/protoc

Reproduction steps

See above.

  • install grpc-tools
  • run node_modules/grpc-tools/bin/protoc --version
  • (you get the same error when running node_modules/grpc-tools/bin/grpc_node_plugin --version)

Environment

  • OS name, version and architecture: MacOS 14.2.1 arm64 (uname -a prints Darwin [device id] 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:51 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6030 arm64)
  • Node version 18.18.2 (also tried 18.19.0)
  • Node installation method volta
  • Package name and version [email protected]

Additional context

I don't think this library is responsible for building the binary that is not working for me, but I also don't know where else to report this error to.

Lukas-Kullmann avatar Jan 18 '24 09:01 Lukas-Kullmann

@Lukas-Kullmann any updates ?

sfarg0 avatar Feb 06 '24 14:02 sfarg0

I installed rosetta (softwareupdate --install-rosetta via CLI) and now it works. Don't know why I need it though.

Lukas-Kullmann avatar Feb 06 '24 15:02 Lukas-Kullmann

Thanks :)

sfarg0 avatar Feb 06 '24 15:02 sfarg0