带有Couchbase数据库的无效ELF标头Node js [英] Invalid ELF header Node js with couchbase db

查看:73
本文介绍了带有Couchbase数据库的无效ELF标头Node js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了一些有关此问题的帖子,但结果似乎都是针对用户配置的。我正在使用带有快速js服务器的couchbase数据库。当我在本地(Windows)运行代码时,它可以正常运行。它自己的数据库托管在Linux服务器上。当我将代码部署到测试环境(linux)时,尝试运行 node server.js时出现此错误:

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 completely 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 committing that'd be helpful to know to.

问题:该怎么办我需要做才能让它运行?

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

推荐答案

在一个体系结构上编译模块时,发生无效的ELF标头错误然后尝试在另一个上运行它们。我猜您是在复制整个项目文件夹,而不是在测试环境中安装特定于体系结构的节点模块。确保正确配置了package.json文件,删除(或者最好不要复制)node_modules文件夹,然后在目标环境上运行 npm install 。这将为特定环境拉出并编译该模块。

The "invalid ELF header" error happens when you compile 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 compile that modules for the particular environment.

这是有关配置和使用package.json的文档页面: https://docs.npmjs.com/getting-started/using-a-package.json

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

这篇关于带有Couchbase数据库的无效ELF标头Node js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆