ftslite icon indicating copy to clipboard operation
ftslite copied to clipboard

Cannot find module '../build/Release/bson'

Open ghost opened this issue 7 years ago • 2 comments

{ Error: Cannot find module '../build/Release/bson' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (C:\App\nodejs\Scripts\fulltext_search\node_modules\bs on\ext\index.js:15:10) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version C:\App\nodejs\Scripts\fulltext_search\node_modules\mongodb\lib\mongodb\connectio n\url_parser.js:14 if(url.indexOf("mongodb://") != 0) ^

TypeError: Cannot read property 'indexOf' of undefined at exports.parse (C:\App\nodejs\Scripts\fulltext_search\node_modules\mongodb \lib\mongodb\connection\url_parser.js:14:9) at Function.MongoClient.connect (C:\App\nodejs\Scripts\fulltext_search\node_ modules\mongodb\lib\mongodb\mongo_client.js:164:16) at Object. (C:\App\nodejs\Scripts\fulltext_search\app.js:15:13) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:389:7)

ghost avatar Jan 21 '18 17:01 ghost

Have you set the MONGOHQ_URL environment variable?

The example is not stopping because of the bson error but because it has no URL to connect to.

The article https://www.compose.com/articles/full-text-search-with-mongodb-and-node-js/ covers the (now four years old) example.

codepope avatar Jan 21 '18 17:01 codepope

perfect! thx. Sorry new to mongo and nodejs. BTW this is a great "tutorial" I was able to more or less copy this to a few webpages I'm writing to incorporate full DB searches. Thx again.

ghost avatar Jan 21 '18 19:01 ghost