-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Environment:Windows 7, 64 bit
v 1.3.11 of the node driver
-
Empty show more show less
When configuring to use the native bson parser on windows, we get an error.
Adding in some missing logging, we see the following error:
%1 is not a valid Win32 application. E:\dev\projects\trunk\server\node_modules\mongodb\node_modules\bson\ext\win32\x64\bson.node 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:380:17) at Object.<anonymous> (E:\dev\projects\trunk\server\node_modules\mongodb\node_modules\bson\ext\index.js:5:10) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)
I monkey-patched the bson/ext/index.js to replace
// Load the precompiled win32 binary if(process.platform == "win32" && process.arch == "x64") { console.log("yes?"); bson = require('./win32/x64/bson'); } else if(process.platform == "win32" && process.arch == "ia32") { bson = require('./win32/ia32/bson'); } else { bson = require('../build/Release/bson'); }
with
bson = require('bindings')('bson');
With my own compiled native component, and all works sweetly.