admin管理员组

文章数量:1323335

I've seen a handful of posts about this issue but the results all seem to be specific to the users configuration. I'm using couchbase db with a express js server. When I run the code locally (windows) it works fine. The database it self is hosted on a linux server. When I deploy the code to our testing environment ( linux ), I'm getting this error when I try to run "node server.js":

/var/www/html/BTRnode/node_modules/couchbase/node_modules/bindings/bindings.js:83
        throw 8
Error: /var/www/html/BTRnode/node_modules/couchbase/build/Release/couchbase_impl.node: invalid ELF header
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:364:17)
    at ....

I'm pletely lost on what to do in this situation. As mentioned before, it seemed to me like all the fixes in other peoples situation was some system configuration. I'm not sure what to post here to help you see any configuration that might help, but I can sure add it if needed. Also if there be a more general solution or error that I'm mitting that'd be helpful to know to.

Question: What do I need to do to get this to run?

I've seen a handful of posts about this issue but the results all seem to be specific to the users configuration. I'm using couchbase db with a express js server. When I run the code locally (windows) it works fine. The database it self is hosted on a linux server. When I deploy the code to our testing environment ( linux ), I'm getting this error when I try to run "node server.js":

/var/www/html/BTRnode/node_modules/couchbase/node_modules/bindings/bindings.js:83
        throw 8
Error: /var/www/html/BTRnode/node_modules/couchbase/build/Release/couchbase_impl.node: invalid ELF header
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:364:17)
    at ....

I'm pletely lost on what to do in this situation. As mentioned before, it seemed to me like all the fixes in other peoples situation was some system configuration. I'm not sure what to post here to help you see any configuration that might help, but I can sure add it if needed. Also if there be a more general solution or error that I'm mitting that'd be helpful to know to.

Question: What do I need to do to get this to run?

Share Improve this question asked Jan 16, 2016 at 0:55 discodanediscodane 2,0954 gold badges25 silver badges38 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

The "invalid ELF header" error happens when you pile modules on one architecture and then try to run them on another. I'm guessing you're copying your entire project folder over, rather than installing the architecture-specific node modules on the testing environment. Make sure your package.json file is configured correctly, delete (or better yet, don't copy) your node_modules folder, and then run npm install on the target environment. This will pull and pile that modules for the particular environment.

Here is the documentation page about configuring and using your package.json: https://docs.npmjs./getting-started/using-a-package.json

本文标签: javascriptInvalid ELF header Node js with couchbase dbStack Overflow