Community Health Toolkit

Development Environment Setup


grunt dev-api throws an error

ERROR: Fatal error initialising medic-api
error: ‘not_found’,
reason: ‘missing’,
status: 404,
name: ‘not_found’,
message: ‘missing’,
docId: ‘_design/medic’
[nodemon] app crashed - waiting for file changes before starting…

do I need to initialize some sort of a dataset to get this working?

1 Like

Sorry that you have run into problems! You can provide demo data to make it interesting at first load, but you shouldn’t need to initialize any data set to get grunt dev-api to work.

It may be helpful to know more about your dev setup. What OS and versions are you running? Which steps have you completed? Seeing that may help to figure things out.

macOS 10.15.3, all steps completed until this step where it fails.

Running “couch-push:localhost” (couch-push) task
Get revisions http://localhost:5984/medic...OK
Pushing http://localhost:5984/medic…>> 201 [

{ id: ‘_design/medic’, error: ‘unknown_error’, reason: ‘undefined’ }
[object Object]
Warning: Task “couch-push:localhost” failed. Use --force to continue.

$COUCH_NODE_NAME and $COUCH_URL are set correctly

I was able to resolve the problem. On mac OSX, please don’t install couchDB using brew. The installation with brew is not compatible with cht-core. I will debug later and find out what the real underlying issue is but reinstalling using the mac installer fixed the problem.