DEV Community

Mick F
Mick F

Posted on

Fixing canvas package install

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' 
Enter fullscreen mode Exit fullscreen mode

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' 
Enter fullscreen mode Exit fullscreen mode

It turns out what fixed the error was:

pip install setuptools 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)