Community Health Toolkit

L get this error when l run grunt dev-api. Please help

grunt dev-api
Running “exec:api-dev” (exec) task
[nodemon] 2.0.5
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): api//* shared-libs//src/**
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node api/server.js --allow-cors

internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module ‘winston’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/clifford/Documents/SolidarMed/iNyashaNCD/cht-core/api/src/logger.js:1:46)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[nodemon] app crashed - waiting for file changes before starting…

1 Like

From the look of that error I think you need to install the node dependencies in the api directory. This should be run by this step in the developer environment setup. Try running grunt in the root directory to install all dependencies and then run grunt dev-api to run the API service.

1 Like