1

so ive been following this tutorial series the guy whos series it is has been no help but when i run i receive this error, has anyone had this error before or knows how to fix it please help me

"C:\Program Files (x86)\JetBrains\WebStorm 10.0.4\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" server.js --env=test
test
Loading Initializer: 00_packetmodels.js
Loading Initializer: 01_mongodb.js
js-bson: Failed to load c++ bson extension, using pure JS version
Loading Model: user.js
Loading Map: prison_1.js
Initialize Completed, Server runnng on port: 8082 for environment: test
c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\base.js:246
        throw message;      
        ^

TypeError: Cannot read property 'length' of undefined
    at processResults (c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1581:31)
    at c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1619:20
    at c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1157:7
    at c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1890:9
    at Server.Base._callHandler (c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\base.js:448:41)
    at c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:481:18
    at MongoReply.parseBody (c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\responses\mongo_reply.js:68:5)
    at null.<anonymous> (c:\Users\poeketis\WebstormProjects\Prison rp\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:439:20)
    at emitOne (events.js:77:13)
    at emit (events.js:169:7)

Process finished with exit code 1

and here is a picture of the mongo log https://i.stack.imgur.com/8clOO.png

1 Answers1

1

this is a very common issue (https://www.google.com.ua/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=js-bson%3a%20failed%20to%20load%20c%2b%2b%20bson%20extension%2c%20using%20pure%20js%20version). Such issues often occur if bson was compiled against a Node version different from the one you run your application with.

lena
  • 90,154
  • 11
  • 145
  • 150