generator-keystone-react icon indicating copy to clipboard operation
generator-keystone-react copied to clipboard

Local Install Fails

Open jpke opened this issue 8 years ago • 8 comments

The last step in the installation sequence:

node keystone

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

Attempting to start with node keystone.js or npm start produces same error. Page fails to load on localhost:3000.

Any help would be greatly appreciated!

Full stack trace: { 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/jpearnest/Apps/my-react-site/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) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/jpearnest/Apps/my-react-site/node_modules/bson/lib/bson/index.js:3:24) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version

jpke avatar Apr 28 '17 18:04 jpke

+1 same issue here

charles-philippe avatar May 09 '17 12:05 charles-philippe

Find [YOUR_PROJECT]/node_modules\bson\ext\index.js

and change path on 10th line

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

charles-philippe avatar May 09 '17 13:05 charles-philippe

takes care of the error but keystone wouldn't init...

charles-philippe avatar May 09 '17 13:05 charles-philippe

You manage to fix?

Having same problem.

waldinho avatar Jun 01 '17 12:06 waldinho

All the steps for installing MongoDB aren't there - you'll need to drop this into your terminal:

mkdir -p /data/db

and then set permissions:

sudo chmod 0755 /data/db
sudo chown $USER /data/db

Then you can navigate back into your project folder and run: mongod because keystone expects to find mongoDB running on localhost in order to initialise (according to getting started docs). Open a new terminal window and 'node keystone' will work.

The documentation needs updating (which they say they're in the middle of doing here: http://keystonejs.com/docs/getting-started/). I might submit a pull request to update the documentation on this repository if no one has any corrections to my suggestions above?

readeral avatar Jun 15 '17 10:06 readeral

Hi , I did the instructions but keystone still do not want to init.

capture d ecran 2018-10-14 a 10 51 08

youbihi avatar Oct 14 '18 08:10 youbihi

@youbihi I replied in the slack channel.

jennaprice avatar Oct 15 '18 11:10 jennaprice

$npm audit fix or $npm audit fix --force fixed the bson problem for me

RichardAgama avatar May 26 '19 07:05 RichardAgama