2๐
โ
On https://www.npmjs.com/package/chartjs-node-canvas, thereโs the following note:
Node JS version
This is limited by the upstream dependency canvas.
Therefore, your problem should be solved if you run the following commands:
npm install canvas
npm rebuild
1๐
open New terminal and write npm command to install module which is chartjs-node-canvas
npm install canvas
npm install chartjs-node-canvas
0๐
I made a blank canvas module, it seems to work.
- Edit
package.json
:
"dependencies": {
"canvas": "file:./src/lib/canvas",
"jsdom": "^21.1.1",
- Create a directory
canvas
in that path andindex.ts/js
with:
module.exports = {};
npm i
- Run the app.
The solution originates from here.
Source:stackexchange.com