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

Error while importing module #150

Open
surdu opened this issue Jun 18, 2020 · 2 comments
Open

Error while importing module #150

surdu opened this issue Jun 18, 2020 · 2 comments

Comments

@surdu
Copy link

surdu commented Jun 18, 2020

I'm running an Express server on an Ubuntu docker instance, and when I try to import the module I get:

internal/modules/cjs/loader.js:1206
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Error loading shared library /app/node_modules/mmmagic/build/Release/magic.node: Exec format error
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1206:18)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/app/node_modules/mmmagic/lib/index.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/app/routes/product.js:7:19)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/app/app.js:11:23)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
@mscdex
Copy link
Owner

mscdex commented Jun 19, 2020

Did you copy the node_modules from another system where the modules was originally installed? I'm betting it was copied either from a different OS (e.g. from macOS to Linux) or from a different, incompatible CPU architecture.

@surdu
Copy link
Author

surdu commented Jun 19, 2020

Hmmm.... You might be onto something 😃 I'll double check my docker configuration tonight and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants