Closed courtneypattison closed 6 months ago
My Jest tests fail to run with the error message Cannot find module '../build/Release/canvas.node' when I have react-pdf installed.
Cannot find module '../build/Release/canvas.node'
react-pdf
pnpm test
Tests should run
$ pnpm rebuild node_modules/.pnpm/canvas@2.11.2/node_modules/canvas: Running install script, failed in 1.1s (skipped as optional) $ pnpm why canvas dependencies: react-pdf 7.7.0 └─┬ pdfjs-dist 3.11.174 └── canvas 2.11.2
See also https://github.com/Automattic/node-canvas/issues/2135
Thank you @wojtekmaj! It's a pnpm issue.
Before you start - checklist
Description
My Jest tests fail to run with the error message
Cannot find module '../build/Release/canvas.node'
when I havereact-pdf
installed.Steps to reproduce
pnpm test
Expected behavior
Tests should run
Actual behavior
Cannot find module '../build/Release/canvas.node'
Additional information
Environment