VaskoDeGame VaskoDeGame - 10 months ago 128
Javascript Question

Problems with AllcountJS Getting Started Guide

I have a problem with the installation of the framework AllcountJS.

I followed everything showed as standard:

But when I start, everything stops on

MacBook-Pro:vdgcrm vdg$ allcountjs run
Using db url: mongodb://localhost:27017/vdgcrm
{ Error: Cannot find module '../build/Release/bson'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/vdg/vdgcrm/node_modules/bson/ext/index.js:15:10)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3) code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
Failed to fetch "app-config". Trying to use as regular directory.

Please help to solve this problem, since it is very necessary for my studies in university.

Answer Source

The error says AllcountJS can't find bson module via npm system. The easiest way to fix that is changing the require path at index.js file.

So, go to node_modules/bson/ext/index.js and change all the lines:

bson = require('../Release/bson');


bson = require('../browser_build/bson');

Also, remember that as per official docs, MongoDB should be running in order to run this example. Then, make sure you have it properly installed and running.