mongodb error

629 views
Skip to first unread message

thoai.h...@census.gov

unread,
Feb 4, 2015, 11:08:33 AM2/4/15
to nod...@googlegroups.com
Hello,
 
I installed mongodb (linux 64-bit version 2.6.7) - MongoDB seems to work fine.  I installed mongodb driver on Node v0.10.36 via npm install mongodb.
 
I ran mongodb in /data/db directory.
 
I got an error message: "[Error: /data/projects/nodejs/mode_modules/mongodb/node_modules/bson/build/Release/bson.node: invalid ELF header] js-bson: Failed to load c++ bson extension, using pure JS version" when trying to execute the below one line of code via running  /data/projects/nodejs/tc4_mongodb_server.js:
 
var mongo = require('mongodb').MongoClient;
 
Please provide any suggestion(s) to fix this problem?
 
Thanks,
>>Thoai

Aria Stewart

unread,
Feb 4, 2015, 11:20:03 AM2/4/15
to nod...@googlegroups.com
You might try running `npm rebuild`, and watch for any compilation errors during that. The error should not be fatal, since there's an all-javascript backup to the c++ bson module, but something's gone awry there.

Make sure your c++ compiler works too.

Aria

thoai.h...@census.gov

unread,
Feb 4, 2015, 11:30:55 AM2/4/15
to nod...@googlegroups.com
I ran npm rebuild.  Things seem to work without any fatal errors.  I run the previous line of code again - I still get the
same error.

Aria Stewart

unread,
Feb 4, 2015, 11:53:26 AM2/4/15
to nod...@googlegroups.com

> On Feb 4, 2015, at 11:30 AM, thoai.h...@census.gov wrote:
>
> I ran npm rebuild. Things seem to work without any fatal errors. I run the previous line of code again - I still get the
> same error.
>

Yeah -- they won't be fatal, because bson has the js fallback, so they treat the "did C++ compile?" as a nice-to-have not a must. Want to gist or post the whole rebuild log? There might be clues there.

Aria

thoai.h...@census.gov

unread,
Feb 4, 2015, 3:17:48 PM2/4/15
to nod...@googlegroups.com
Any way, the error message is just the warning.  Currently, I plan to only use Javascript -  I may need to use C++ later, but not now.   I added more
code to connect to the mongodb and it seems to get through with no errors.  I will continue my application development ....  I will try to inserts records
to the db...hopefully things will work.
 
>>Thoai 

Daniel Alberto Martinez

unread,
Feb 5, 2015, 8:54:36 AM2/5/15
to nod...@googlegroups.com
Hi Thoai, 

If your web application is a common CRUD  you can test this module: https://www.npmjs.com/package/mpill
That module helps you to encapsulate the connect and db close and you do not need to be worried about db connections.
Reply all
Reply to author
Forward
0 new messages