From 4197f6a284790d323b5c11c6cb0a0de1f9eaff12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 10 Jan 2024 15:21:15 +0100 Subject: [PATCH] Add note about running `npm install` on MacOS --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 14d56af2b..a90090272 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,9 @@ If everything worked out, install all dependencies for PDF.js: $ npm install +> [!NOTE] +> On MacOS M1/M2 you may see some `node-gyp`-related errors when running `npm install`. This is because one of our dependencies, `"canvas"`, does not provide pre-built binaries for this platform and instead `npm` will try to build it from source. Please make sure to first install the necessary native dependencies using `brew`: https://github.com/Automattic/node-canvas#compiling. + Finally, you need to start a local web server as some browsers do not allow opening PDF files using a `file://` URL. Run: