Skip to content

[BUG] Doesn't run in Node-RED/Alpine Linux #30

Description

@AndreKR

Describe the bug
This might be somewhat of a feature request but since there's an error message I'm using the bug template.

To Reproduce

  1. Start a Docker container with Node.js that is based on Alpine Linux, for example nodered/node-red:
docker run -it --rm --entrypoint /bin/bash --user root nodered/node-red
  1. Create some test scripts:
cd /
mkdir test
cd test
npm install imagescript
echo "import {Image} from 'imagescript'; const i = new Image(200, 200);" > test.mjs
  1. Run the script:
node test.mjs

Actual behavior

An error message appears:

# node test.mjs
/test/node_modules/imagescript/codecs/node/index.js:3
catch (err) { throw new Error('unsupported arch/platform: ' + err.message); }
                    ^

Error: unsupported arch/platform: Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /test/node_modules/imagescript/codecs/node/bin/arm64-linux.node)
    at Object.<anonymous> (/test/node_modules/imagescript/codecs/node/index.js:3:21)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/test/node_modules/imagescript/ImageScript.js:4:16)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)

Expected behavior
Script runs, no output

Platform:

  • OS: Linux
  • Environment: NodeJS in Docker
  • Version: 1.2.16

Additional context
I tried apk add gcompat and apk add libc6-compat. It changes the error message into:

# node test.mjs
/test/node_modules/imagescript/codecs/node/index.js:3
catch (err) { throw new Error('unsupported arch/platform: ' + err.message); }
                    ^

Error: unsupported arch/platform: Error relocating /test/node_modules/imagescript/codecs/node/bin/arm64-linux.node: __memcpy_chk: symbol not found
    at Object.<anonymous> (/test/node_modules/imagescript/codecs/node/index.js:3:21)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/test/node_modules/imagescript/ImageScript.js:4:16)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions