infinyon / fluvio-client-node

Node.js client for Fluvio
https://infinyon.github.io/fluvio-client-node/
Apache License 2.0
9 stars 10 forks source link

nodejs fluvio/client package throwing improper architecture error on Apple Silicon #210

Closed LanceEa closed 2 years ago

LanceEa commented 2 years ago

What happened When following the Hello Fluvio Node Example on a Mac M1 (arm64) an error is thrown trying to run producer.ts.

npx ts-node producer.ts

Error: dlopen(/Users/lance/code/learn-fluvio/fluvio-demo/node_modules/@fluvio/client/dist/darwin/index.node, 0x0001): tried: '/Users/lance/code/learn-fluvio/fluvio-demo/node_modules/@fluvio/client/dist/darwin/index.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/index.node' (no such file), '/usr/lib/index.node' (no such file)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1179:18)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/lance/code/learn-fluvio/fluvio-demo/node_modules/@fluvio/client/src/index.ts:43:16)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'ERR_DLOPEN_FAILED'

# confirm node process is running on arm64 architecture
node -p process.arch
arm64

Expected behavior I would expect the fluvio/client package to support Apple Silicon.

Describe the setup

Release Channel      : stable
Fluvio CLI           : 0.9.18
Fluvio CLI SHA256    : f97262eec5fcb1f0b05c3cd6d1a7cdf40cfe83d1c5b702be49b82aa4575f409e
Fluvio Platform      : 0.9.18 (kind-fluvio)
Git Commit           : 2b6397f56e3935807ebb9e84c60517f815426d51
OS Details           : Darwin 12.1 (kernel 21.2.0)
=== Plugin Versions ===
Fluvio Runner (fluvio-run)     : 0.0.0
Infinyon Cloud CLI (fluvio-cloud) : 0.1.6

How to reproduce it (as minimally and precisely as possible) Steps to reproduce the behavior:

  1. Follow the steps outlined in the NodeJs HelloWorld example
  2. Alternatively, if you just const fluvio = new Fluvio(); into a typescript file and run it will trigger the issue.
sehz commented 2 years ago

related to: #108

simlay commented 2 years ago

Fixed in #215.