Community Health Toolkit

Building app on CLI fails

I have added my first task.
According to the docs once editing the file tasks.js the app must be rebuild using the command

cht --url=https://<username>:<password>@localhost --accept-self-signed-certs compile-app-settings backup-app-settings upload-app-settings

I get a lot of errors of which some are green and some are red.

If I run the command as sudo I cannot access the file /tmp/contact-summary.js.

Can someone help me out here?

I believe you are running into this known issue.

If you are modifying the cht-core configs you will need to do npm ci before the eslint file is pulled in.


Dear Nick,

This was it! I installed npm ci and then I got further.
I still had issues running the command without root privileges and root could not access the file /tmp/contact-summary.js.

I was wondering from the beginning why my entire cht-core folder belonged to root. So I solved this issue by changing the owner of all cht related files to ubuntu user.

I wonder if this is standard or if I did something wrong, I will check.

Many thanks, what a relief!

Typically the owner of the cht-core directory/files would be whatever user that you used to run the git clone... command to initially download the repository. If you happened to run sudo git clone... then that would probably have assigned the cht-core directory/files to root.

1 Like