Skip to main content
Mark Llobrera

Top level navigation menu

Homebrew and Apple Silicon Macs

While kicking the tires on Autogram’s content tool1 Spidergram I ran into a puzzling error:

Error: dlopen(/Users/markllobrera/git-workspace/ammp-spidergram/node_modules/canvas/build/Release/canvas.node, 0x0001): symbol not found in flat namespace (_cairo_fill)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1361:18)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Function.Module._load (node:internal/modules/cjs/loader:972:12)
    at Module.require (node:internal/modules/cjs/loader:1157:19)
    at require (node:internal/modules/helpers:119:18)
    at Object.<anonymous> (/Users/markllobrera/git-workspace/ammp-spidergram/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Object.require.extensions.<computed> [as .js] (/Users/markllobrera/git-workspace/ammp-spidergram/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1133:32) {

A few dozen browser tabs later it appeared that this was related to dependencies that were not compatible with ARM64, aka the architecture used by the new Mx series of Apple silicon. Further investigation revealed that it wasn’t just Spidergram’s NodeJS package dependencies, but the Python dependencies underneath.

[Deep Breath]

My initial instinct, as is typical for me, was to set my machine on fire and renounce this career.

I slept on it instead, and here was what I found:

To clean this up:

After all that I was able to run npm install within my Spidergram project and those dependencies now pointed to the latest Python version.

All of this reminded me of Alex Riviere’s recent post, “Delete Your Dev Environment Regularly”. I think if I had to do things over I would have chosen not to use Migration Assistant and reinstalled my tooling from scratch.

  1. This description does Spidergram a disservice, it is a really ambitious and exciting inventory/analysis tool ↩︎