Skip to content

Commit

Permalink
Fix node-canvas source compile for node >= v21 (#4122)
Browse files Browse the repository at this point in the history
The maplibre-gl-js install currently fails on arm64 macs when running
Node >= 21.

The error is:

```
../../nan/nan.h:2546:8: error: no matching member function for call to 'SetAccessor'
tpl->SetAccessor(
```

The context is that `maplibre-gl-js` depends on `node-canvas@2.x` which has a
dependency on the `nan` package and `nan` 2.17 had a bug that surfaced with
node v21: nodejs/nan#966.

Additionally `node-canvas` does not currently provide pre-compiled
binaries for Arm64, so a source compile is needed.

So, the solution here is to upgrade the `nan` version to the latest
release which fixes support with recent node.
  • Loading branch information
springmeyer committed May 17, 2024
1 parent dac8f27 commit 753204c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 753204c

Please sign in to comment.