You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠ Error: The module '/Users/***/functions/node_modules/canvas/build/Release/canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at tryImporting (pkg/prelude/bootstrap.js:1736:37)
at process.dlopen (pkg/prelude/bootstrap.js:1762:5)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1186:18)
at Module.load (internal/modules/cjs/loader.js:984:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1024:19)
at Module.require (pkg/prelude/bootstrap.js:1338:31)
at Module.Hook._require.Module.require (/Users/lenskart/Work/FirebaseConsumer/functions/node_modules/require-in-the-middle/index.js:80:39)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/Users/lenskart/Work/FirebaseConsumer/functions/node_modules/canvas/lib/bindings.js:3:18)
⚠ We were unable to load your functions code.
Your Environment
Version of node-canvas (output of npm list canvas or yarn list canvas): canvas@2.6.1 / 2.8.0
Environment (e.g. node 4.2.0 on Mac OS X 10.8): v10.16.0 on MacOS X @10.14.6
tcs @4.5.2
firebase @9.22.0
node @10.16.0
I understand this is a duplicate issue, but the solutions in SO/ these threads here didn't help:
Issue
⚠ Error: The module '/Users/***/functions/node_modules/canvas/build/Release/canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using
npm rebuild
ornpm install
).at tryImporting (pkg/prelude/bootstrap.js:1736:37)
at process.dlopen (pkg/prelude/bootstrap.js:1762:5)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1186:18)
at Module.load (internal/modules/cjs/loader.js:984:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1024:19)
at Module.require (pkg/prelude/bootstrap.js:1338:31)
at Module.Hook._require.Module.require (/Users/lenskart/Work/FirebaseConsumer/functions/node_modules/require-in-the-middle/index.js:80:39)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/Users/lenskart/Work/FirebaseConsumer/functions/node_modules/canvas/lib/bindings.js:3:18)
⚠ We were unable to load your functions code.
Your Environment
npm list canvas
oryarn list canvas
): canvas@2.6.1 / 2.8.0I understand this is a duplicate issue, but the solutions in SO/ these threads here didn't help:
npm rebuild
ornpm install
). #1879I have compiled the solutions I've tried, as they might be of help to others.
What I've tried:
1. Reinstall canvas
Delete node_modules
Delete package-lock.json
npm uninstall canvas
npm i
2. Rebuild canvas [@obihill]
Delete node_modules directory
npm install
npm rebuild --build-from-source canvas
3. Rebuild canvas and update its binary [SO]
npm rebuild canvas --update-binary
4. Install using Homebrew [Canvas Wiki]
brew install pkg-config cairo pango libpng jpeg giflib librsvg
5. Use the latest version of canvas:
npm uninstall canvas
npm i canvas@latest
[2.6.1 -> 2.8.0]
6. Verify cache content after uninstalling
npm uninstall canvas
npm cache verify
npm i canvas
[still get NODE_MODULE_VERSION error while running functions]
7. Parallel reinstall of canvas
(a partially-working solution)
I did a local serve of my project, then installed canvas in parallel:
TERMINAL1:
npm uninstall canvas
TERMINAL1:
npm cache verify
TERMINAL1:
tsc && firebase serve --only hosting,functions
[
tsc --watch && firebase serve --only hosting,functions
doesn't work as intended]TERMINAL2:
npm i canvas
[no error this time]
TERMINAL1: Stop serving, and serve again
[don't get NODE_MODULE_VERSION error anymore]
However, I have to build my project again each time I make code changes.
Of course, if I delete package-lock.json, I get the same issue again :(
The text was updated successfully, but these errors were encountered: