Skip to content
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

UPGRADE TO Node-108 #2132

Closed
makarasty opened this issue Oct 11, 2022 · 11 comments
Closed

UPGRADE TO Node-108 #2132

makarasty opened this issue Oct 11, 2022 · 11 comments

Comments

@makarasty
Copy link

UPGRADE TO Node-108

node:internal/modules/cjs/loader:1189
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^
Error: The module '/home/container/node_modules/canvas/build/Release/canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 108. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:827:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/container/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:827:12) {
  code: 'ERR_DLOPEN_FAILED'
}
Node.js v18.2.0
@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

@makarasty as the error message suggests, could you try and run npm rebuild, or if that doesn't work delete node_modules and run npm install again?

@makarasty
Copy link
Author

makarasty commented Oct 11, 2022

I tried to manually install but could not find version 108

npm ERR! path /home/container/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/home/container/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/container/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | linux | x64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.10.1/canvas-v2.10.1-node-v108-linux-glibc-x64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.1/canvas-v2.10.1-node-v108-linux-glibc-x64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v108 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.1/canvas-v2.10.1-node-v108-linux-glibc-x64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.2.0/node-v18.2.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.2.0/node-v18.2.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.2.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.2.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/container/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/container/.cache/node-gyp/18.2.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/container/.cache/node-gyp/18.2.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/container/.cache/node-gyp/18.2.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/container/node_modules/canvas',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! /bin/sh: 1: pkg-config: not found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.10.0-18-amd64
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/home/container/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/container/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /home/container/node_modules/canvas
npm ERR! gyp ERR! node -v v18.2.0
npm ERR! gyp ERR! node-gyp -v v9.0.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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/home/container/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/container/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/container/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1090:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.10.0-18-amd64
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/home/container/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd /home/container/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v18.2.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/container/.npm/_logs/2022-10-11T09_24_02_568Z-debug-0.log

@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

We currently don't provide pre-builds for that version of Node.js, so you'll have to build the package from source in the meantime.

As per the instructions here https://github.com/Automattic/node-canvas#compiling, I think that all you need to to is to install the right dependencies, then you can try rebuilding again.

@makarasty
Copy link
Author

makarasty commented Oct 11, 2022

We currently don't provide pre-builds for that version of Node.js, so you'll have to build the package from source in the meantime.

As per the instructions here https://github.com/Automattic/node-canvas#compiling, I think that all you need to to is to install the right dependencies, then you can try rebuilding again.

Since my application is hosted on a host I can't solve this problem this way
Hosting gives an error `unknown command' or error 127

@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

Could you compile on your machine, before uploading to your host? E.g. in Docker to match the remote host os/configuration?

Otherwise I would recommend using the LTS version of Node.js, which we should provide prebuilds for. That is currently version 16.17.1.

@makarasty
Copy link
Author

makarasty commented Oct 11, 2022

I can't use a node version lower than 108 because I have many other dependencies that I can't use without
I need either a newer replacement for this module or a beta version of this module compatible with 108

@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

Currently there isn't any newer builds available, beta or not. But if you want to work on this we would be happy to accept a pull request to this repo: https://github.com/node-gfx/node-canvas-prebuilt

I'm personally not up to speed with how it works, but I believe that everything needed to build different versions is in that repo.

@makarasty
Copy link
Author

Currently there isn't any newer builds available, beta or not. But if you want to work on this we would be happy to accept a pull request to this repo: https://github.com/node-gfx/node-canvas-prebuilt

I'm personally not up to speed with how it works, but I believe that everything needed to build different versions is in that repo.

can you do it for me, as I am a simple man and do not understand these clever actions

@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

can you do it for me, as I am a simple man and do not understand these clever actions

I don't have time for this right now, but it's certainly something we'll get to in time. Especially when Node.js 18 becomes the new LTS release...

@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

Just found another issue that already tracks Node.js 18 support: #2025

Closing this as a duplicate...

@LinusU LinusU closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2022
@LinusU
Copy link
Collaborator

LinusU commented Oct 11, 2022

Duplicate of #2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants