-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm intall not working on node v22 #2377
Comments
Node.js 22 was just released, and it seems like it's not compatible with the `canvas` package. This commit pins the version on GitHub actions to Node.js 21 as a temporary workaround. This commit should be reverted once Automattic/node-canvas#2377 is fixed.
Node.js 22 includes v8/v8@e48c472, which removed the v8::ObjectTemplate::SetAccessor(
v8::Local<v8::String>&,
void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&),
void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&),
v8::Local<v8::Object>&,
v8::AccessControl&, // Removed!
v8::PropertyAttribute&
) #2235 probably fixed this problem by not using |
@hong6316 use
in your package.json for the time being ... Works with node 22 |
needed because of Automattic/node-canvas#2377
Not yet adding 22 because of Automattic/node-canvas#2377
Not yet adding 22 because of Automattic/node-canvas#2377
needed because of Automattic/node-canvas#2377
That's not possible, I didn't add the canvas module directly to package.json. |
@hong6316 |
Adding "overrides": {
"canvas": "Automattic/node-canvas#master"
} bun i
[0.06ms] ".env"
bun install v1.1.9 (bb13798d)
[13.25ms] migrated lockfile from package-lock.json
error: canvas@^2.11.2 failed to resolve
error: canvas@^2.11.2 failed to resolve |
|
this package is killing me, i have no idea what to do now.
|
Are you sure you're using Node 20? The output you posted suggests you're on Node 18. I solved the issue by downgrading from 22 to 20. Double check your versions, and perhaps restart your terminal so you don't have an old version lingering around referenced in an environment variable. |
@letharion i have tried node 18 and node 20, both of them are failed. after upgrade the canvas package, and it just works(i can confirm that the previous version of canvas should support node 18, because i copy the package.json depencies from my another pc). |
Anyone using Windows x64 or Linux x64/glibc, please try For any other platforms and architectures, v3.0.0 can be built from source following the compilation section of the readme. MacOS prebuilds should be coming soon. |
With yarn I was able to fix by adding to package.json
|
Nice, I went with: "resolutions": {
"canvas": "github:Automattic/node-canvas#a2e10e6"
} |
Needed to upgrade canvas to a git rev due to Automattic/node-canvas#2377
Needed to upgrade canvas to a git rev due to Automattic/node-canvas#2377
Needed to upgrade canvas to a git rev due to Automattic/node-canvas#2377
Needed to upgrade canvas to a git rev due to Automattic/node-canvas#2377
Needed to upgrade canvas to a git rev due to Automattic/node-canvas#2377
* Remove @types/cookie stub * Remove @types/cookie from lockfile * Upgrade to node-addon-api@7.1.0 * Upgrade to canvas@3.0.0-rc2 - https://github.com/Automattic/node-canvas/releases/tag/v3.0.0-rc2 - Automattic/node-canvas#2377 (comment) * Upgrade to node-gyp@10.2.0 * Install pango and cairo * Change to pull_request trigger * Switch back to only `push` trigger Revert this for now: 3d62d34#diff-def01120c202f13a2f33e11a966318cd2b5f80b66a28ea61d68001c56fd53214R4
Needed to upgrade canvas to a git rev due to Automattic/node-canvas#2377
Issue or Feature
npm intall not working on node v22.
I checked #1511 but the error log is not the same
I already proceed the below step but It's not working on node 22(other node versions work fine)
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
https://app.travis-ci.com/github/enactjs/sandstone/jobs/620963689
Steps to Reproduce
https://app.travis-ci.com/github/enactjs/sandstone/jobs/620963689
Your Environment
npm list canvas
oryarn list canvas
): v2.11.2The text was updated successfully, but these errors were encountered: