I am working on NodeJS on OpenShift and run into a problem when I try to start the Mosca server on a Node instance. The error I am getting is as follows:
[Error: /var/lib/openshift/5547bd284382ec394a000088/app-root/runtime/repo/node_modules/mosca/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/node_modules/bson-ext/build/Release/bson.node: invalid ELF header] js-bson: Failed to load c++ bson extension, using pure JS version
I recently created a new application (on OpenShift) using a NodeJS cartridge and cloned a sample git repository application from the cartridge as a starting point. I added mosca to this via npm ( npm install mosca --save ). Even without using Mongo as a permanent storage for Mosca, therefore, just working in memory, I get the error shown above when the application starts. This is great when I run it on my laptop, in the same versions of everything as far as I can tell.
I already tried a few things that I found in Stack Overflow, for example, building all the dependent modules before pushing the code on git and clearing the cache-npp, but to no avail.
I would appreciate it if someone had a similar experience with other modules or with the same experience with Mosca and he could point me in the right direction.
Sincerely.
The following is a standard Node application template template with a sample Mosca server in the startup function.
#!/bin/env node // OpenShift sample Node application var express = require('express'); var fs = require('fs'); var mosca = require('mosca'); /** * Define the sample application. */ var SampleApp = function() { // Scope. var self = this; /* ================================================================ */ /* Helper functions. */ /* ================================================================ */ /** * Set up server IP address and port
source share