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

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

Open
AndreKR opened this issue Aug 15, 2023 · 1 comment
Open

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

AndreKR opened this issue Aug 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@AndreKR
Copy link

AndreKR commented Aug 15, 2023

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)
@AndreKR
Copy link
Author

AndreKR commented Aug 15, 2023

I just found out that Node-RED recently introduced Debian-based Docker images, so this isn't an actual concern for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant