Skip to content

Error: when using the layer in Node v18 #13

Closed
@ghost

Description

Hi @charoitel - thank you for this work. Really helped me out.

We built the layer using your AWS serverless application. It works fine in v16, though when using as a layer in Node v18 we get intermittent errors:

    "errorType": "Error",
    "errorMessage": "The module '/opt/nodejs/node_modules/canvas/build/Release/canvas.node'\nwas compiled against a different Node.js version using\nNODE_MODULE_VERSION 93. This version of Node.js requires\nNODE_MODULE_VERSION 108. Please try re-compiling or re-installing\nthe module (for instance, using `npm rebuild` or `npm install`).",
    "code": "ERR_DLOPEN_FAILED",

We also used Cloud9 to step through your code and run it just for Node v18 and it gives a similar error:

 "errorType": "Error",
  "errorMessage": "The module '/opt/nodejs/node_modules/canvas/build/Release/canvas.node'\nwas compiled against a different Node.js version using\nNODE_MODULE_VERSION 93. This version of Node.js requires\nNODE_MODULE_VERSION 108. Please try re-compiling or re-installing\nthe module (for instance, using `npm rebuild` or `npm install`).",
  "trace": [
    "Error: The module '/opt/nodejs/node_modules/canvas/build/Release/canvas.node'",
    "was compiled against a different Node.js version using",
    "NODE_MODULE_VERSION 93. 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`).",

Thank you so much in advance!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions