Skip to content

Commit

Permalink
[CP-XXX] Add Troubleshooting for Node.js architecture issues after Ap…
Browse files Browse the repository at this point in the history
…ple Silicon migration (#2139)
  • Loading branch information
dkarski authored Oct 22, 2024
1 parent c7b14df commit 75369fa
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,37 @@ Example on how to install it on macOS using Homebrew:
source ~/.zshrc
```

### Checking Node.js Architecture Compatibility After Migration to Apple Silicon

Incompatibility between the Node.js architecture and your Mac's processor (Intel vs. Apple Silicon) often occurs after migrating between devices with different processors. This test will help you determine if this is the source of the issue.

#### Example Error:

```
App threw an error during load
Error: dlopen(/path/to/node_modules/@serialport/bindings-cpp/prebuilds/darwin-x64+arm64/node.napi.node, 0x0001):
tried: '.../node.napi.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')),
...
```

#### Steps:

##### Check your computer's architecture:

```
arch
```

##### Check Node.js architecture:

```
node -p "process.arch"
```

##### Compare the results:

- If the computer's architecture and Node.js architecture are different, reinstall Node.js to match your computer's architecture.

### The module was compiled against a different Node.js version

```bash
Expand Down

0 comments on commit 75369fa

Please sign in to comment.