JoshKaufman / ursa

URSA - RSA public/private key OpenSSL bindings for Node.js
Other
620 stars 135 forks source link

Error: Dynamic loading not supported on Alpine Linux #138

Closed bajacondor closed 8 years ago

bajacondor commented 8 years ago

Hello, I'm getting this error:

runway/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: Dynamic loading not supported
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at bindings (/opt/nord/runway/node_modules/bindings/bindings.js:76:44)
    at Object. (/opt/nord/runway/node_modules/ursa/lib/ursa.js:18:37)
    at Module._compile (module.js:541:32)

When running the following code on an Alpine Linux docker base image:

var ursa = require('ursa');
var fs = require('fs');
var crypt=fs.readFileSync('keyfile.pem', 'utf8');
var out = ursa.createPrivateKey(crypt, 'XXXXXX', 'utf8')
console.log(out.toPrivatePem('utf8'));

Is there a way around this?
Thank you!

bajacondor commented 8 years ago

This can be closed. My problem was that node had been built with the --fully-static config flag which disables dynamic loading of libs.