Installing latest Canvas in docker

  canvas, dockerfile, e2e, node.js, npm

I want to run protractor UI automation in docket image but I get the following error when test starts executing. I tried npm install canvas but that fails with a bunch of other errors. Any thoughts on I can move forward?

[20:56:24] E/launcher – The module ‘/opt/atlassian/pipelines/agent/build/node_modules/canvas/build/Release/canvas.node’
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. This version of Node.js requires
NODE_MODULE_VERSION 88. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
[20:56:24] E/launcher – Error: The module ‘/opt/atlassian/pipelines/agent/build/node_modules/canvas/build/Release/canvas.node’
was compiled against a different Node.js version using
NODE_MODULE_VERSION 79. This version of Node.js requires
NODE_MODULE_VERSION 88. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1167:18)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object. (/opt/atlassian/pipelines/agent/build/node_modules/canvas/lib/bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
[20:56:24] E/launcher – Process exited with error code 199
npm ERR! code 199
npm ERR! path /opt/atlassian/pipelines/agent/build
npm ERR! command failed
npm ERR! command sh -c npm run build-e2e && protractor browser-tests/_built/jasmine-config.js –suite deployment "–browser=headlessChrome" "–env=local" "–locale=en-us"
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-02-11T20_56_24_579Z-debug.log

Source: Dockerfile Questions

LEAVE A COMMENT