Add note about running npm install on MacOS

This commit is contained in:
Nicolò Ribaudo 2024-01-10 15:21:15 +01:00
parent 903af4ee00
commit 4197f6a284
No known key found for this signature in database
GPG Key ID: AAFDA9101C58F338

View File

@ -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: