Automattic / Automattic/node-canvas

Installation error "TypeError: Method height called on incompatible receiver #<Canvas>"

Open
#1,884 0 comments 0 reactions 0 assignees View on GitHub
Installation help
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## I have a installation problem :(

A week ago, I have updated nodeJS from v14 to v16, and i want to use canvas.

But when i run "npm i canvas", the error below appears :

```js
node:internal/errors:464
ErrorCaptureStackTrace(err);
^

Error [ERR_INTERNAL_ASSERTION]: Error [ERR_INTERNAL_ASSERTION]: Error [ERR_INTERNAL_ASSERTION]: TypeError: Method height called on incompatible receiver #
at getOwnPropertyDescriptor ()
at formatProperty (node:internal/util/inspect:1674:18)
at formatRaw (node:internal/util/inspect:1004:9)
at formatValue (node:internal/util/inspect:791:10)
at formatProperty (node:internal/util/inspect:1679:11)
at formatRaw (node:internal/util/inspect:1004:9)
at formatValue (node:internal/util/inspect:791:10)
at formatProperty (node:internal/util/inspect:1679:11)
at formatRaw (node:internal/util/inspect:1004:9)
at formatValue (node:internal/util/inspect:791:10)
at Object.inspect (node:internal/util/inspect:338:10)
at getGoodLength (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:31:65)
at msgResponse (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:42:108)
at Object.exe (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:59:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

at new NodeError (node:internal/errors:371:5)
at Function.fail (node:internal/assert:20:9)
at handleMaxCallStackSize (node:internal/util/inspect:1368:10)
at formatRaw (node:internal/util/inspect:1011:12)
at formatValue (node:internal/util/inspect:791:10)
at formatProperty (node:internal/util/inspect:1679:11)
at formatRaw (node:internal/util/inspect:1004:9)
at formatValue (node:internal/util/inspect:791:10)
at formatProperty (node:internal/util/inspect:1679:11)
at formatRaw (node:internal/util/inspect:1004:9)
at formatValue (node:internal/util/inspect:791:10)
at Object.inspect (node:internal/util/inspect:338:10)
at getGoodLength (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:31:65)
at msgResponse (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:42:108)
at Object.exe (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:59:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

at new NodeError (node:internal/errors:371:5)
at Function.fail (node:internal/assert:20:9)
at handleMaxCallStackSize (node:internal/util/inspect:1368:10)
at formatRaw (node:internal/util/inspect:1011:12)
at formatValue (node:internal/util/inspect:791:10)
at formatProperty (node:internal/util/inspect:1679:11)
at formatRaw (node:internal/util/inspect:1004:9)
at formatValue (node:internal/util/inspect:791:10)
at Object.inspect (node:internal/util/inspect:338:10)
at getGoodLength (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:31:65)
at msgResponse (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:42:108)
at Object.exe (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:59:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

at new NodeError (node:internal/errors:371:5)
at Function.fail (node:internal/assert:20:9)
at handleMaxCallStackSize (node:internal/util/inspect:1368:10)
at formatRaw (node:internal/util/inspect:1011:12)
at formatValue (node:internal/util/inspect:791:10)
at Object.inspect (node:internal/util/inspect:338:10)
at getGoodLength (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:31:65)
at msgResponse (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:42:108)
at Object.exe (C:\Users\CEDRIC\code\eden\LanaPUBLIC\exe\cmd\dev\eval.js:59:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ERR_INTERNAL_ASSERTION'
}
```

## My environnement
* Windows 10 21H1
* Node JS 16.7.0
* npm 7.20.3

I have already run the nodeJS repear script but without success...

I'm coming to you because I think you have the answer, could someone help me to understand and fix the problem ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.