trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
185.07k stars 29.85k forks source link

Fix the repo build for Apple M1 laptops #1029

Closed trekhleb closed 1 year ago

trekhleb commented 1 year ago

See the Can't install canvas npm package on Apple M1 issue for more details.

Basically, the solution is to replace the node-canvas with pngjs npm package.

Keeping the node-canvas package would require the M1 users to install the following dependencies (which is the overhead for this repo): brew install pkg-config cairo pango libpng jpeg giflib librsvg