Open SrS2225a opened 2 years ago
Hi there!
As per the NodeJS version section on the docs, node-canvas
does note yet support node 18.x. You need to wait for support to be added or use a supported version like 16.x.x
.
I see, thank you. Is there a work around for now? And if not, is there an eta for when v18 will be supported? I could downgrade, but I don't want to risk breaking other node packages
Hi there!
As per the NodeJS version section on the docs,
node-canvas
does note yet support node 18.x. You need to wait for support to be added or use a supported version like16.x.x
.
NodeJS v16.13.2
throws the same error:
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute ...
Same as @NekitCorp :
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments:
Directory: ../node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.9
node-pre-gyp info using node@16.13.2 | darwin | arm64
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.9.3 and node@16.13.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@8.3.0
gyp info using node@16.13.2 | darwin | arm64
https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v93-darwin-unknown-arm64.tar.gz seems a not so valid path. 404. Looks like all the releases end with x64.tar.gz, while I have a arm64.tar.gz target :(
Anyone know how to fix this? I'm running M1 chip on Mac Pro
So I did some research:
node-canvas currently does not support arm You need to make a build yourself The docs on that are pretty straight forward when found: https://github.com/Automattic/node-canvas/wiki#installation-guides
brew install pkg-config cairo pango libpng jpeg giflib librsvg
then
yarn add chartjs-node-canvas
# or
npm install chartjs-node-canvas
And you should be all set! It tries to make a own build so the yarn/npm command can take a while.
PS C:\Users\tortu\Desktop\AI-Moderation-master> npm run start
npm WARN config global --global
, --local
are deprecated. Use --location=global
instead.
ai-moderation@1.0.0 start node dist/main.js
╭───────────────────────────────────────────────────────────────────╮ │ │ │ Discord.js: v14.1.2 │ │ │ │ Events: OK │ │ Commands: OK │ │ Database: MongoServerError: bad auth : Authentication failed. │ │ │ ╰───────────────────────────────────────────────────────────────────╯
my console said this when i started the bot, how can i fix it?
It seems like https://github.com/Automattic/node-canvas/issues/2025 got resolved and canvas supports Node 18 now. Can the dep be updated?
Tried it here real quick: https://github.com/Stannnnn/ChartjsNodeCanvas and it seems to still generate an image.
@SeanSobey Is this project still maintained? Can we at least bump the "canvas" dep so this works on Node 18+?
Describe the bug A while ago I ran into an issue where an required dependency canvas was telling me it was complied against a older node version, so I went through the suggested steps of running
npm install
andnpm rebuild
, both of which did not work, so eventually I did a full uninstall of chart js node canvas, then installed it again. But after doing so. this time it was giving me a critical error that it could not make the dependency. What is the reason for this? This is the full error:Versions