After a clean macOS reinstall, running a web project using the canvas package (via react-pdf) failed with the following error:

Cannot find module '../build/Release/canvas.node'

Many occurrences online suggested that fixing this only required to reinstall the package but it turns out that in my case, a Python library was missing:

ModuleNotFoundError: No module named 'distutils'

It turns out what fixed the error was:

pip install setuptools

💻

Mick F @dirtyhenry