I am having a nodejs(expressjs) application which runs fine locally but when I deploy it to Openshift i got an exception when i check the log file it has the following error when including this line in server.js.
我有一个nodejs(expressjs)应用程序,它在本地运行良好,但当我将它部署到Openshift时,我检查日志文件时遇到异常,当它在server.js中包含此行时出现以下错误。
var mongojs = require("mongojs");
DEBUG: Sending SIGTERM to child...
DEBUG: Running node-supervisor with
DEBUG: program 'server.js'
DEBUG: --watch '/var/lib/openshift/5522627bfcf9336fbc00016a/app-root/data/.nodewatch'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js|coffee'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node server.js'
DEBUG: Watching directory '/var/lib/openshift/5522627bfcf9336fbc00016a/app-root/data/.nodewatch' for changes.
[Error: /var/lib/openshift/5522627bfcf9336fbc00016a/app-root/runtime/repo/node_modules/mongojs/node_modules/mongodb/node_modules/bson/build/Release/bson.node: wrong ELF class: ELFCLASS32]
js-bson: Failed to load c++ bson extension, using pure JS version
App is running on port : 3000
1 个解决方案
#1
2
It looks like your bson or mongodb was built for a 32 bit system but you are trying to load it on a 64 bit system (or some other architecture).
看起来你的bson或mongodb是为32位系统构建的,但是你试图在64位系统(或其他一些架构)上加载它。
I imagine you have a 32 bit system and you are deploying built binaries as well.
我想你有一个32位系统,你也在部署构建的二进制文件。
How did you install mongodb on your system? Try reinstalling it on the target system from source (try removing the node_modules dir altogether and running npm install again).
你是如何在你的系统上安装mongodb的?尝试从源代码重新安装目标系统(尝试完全删除node_modules目录并再次运行npm install)。
As an advice for the future, it's usually a good idea to deploy only the package.json file of your project and perform npm install locally.
作为对未来的建议,通常最好只部署项目的package.json文件并在本地执行npm install。
#1
2
It looks like your bson or mongodb was built for a 32 bit system but you are trying to load it on a 64 bit system (or some other architecture).
看起来你的bson或mongodb是为32位系统构建的,但是你试图在64位系统(或其他一些架构)上加载它。
I imagine you have a 32 bit system and you are deploying built binaries as well.
我想你有一个32位系统,你也在部署构建的二进制文件。
How did you install mongodb on your system? Try reinstalling it on the target system from source (try removing the node_modules dir altogether and running npm install again).
你是如何在你的系统上安装mongodb的?尝试从源代码重新安装目标系统(尝试完全删除node_modules目录并再次运行npm install)。
As an advice for the future, it's usually a good idea to deploy only the package.json file of your project and perform npm install locally.
作为对未来的建议,通常最好只部署项目的package.json文件并在本地执行npm install。