Errors While installing @dhis2/cli

Hello everyone.
Wihle attempting to install @dhis2/cli on Ubuntu 22.04 via yarn global add @dhis2/cli,
I encountered the following error messages, in addition to many warnings:



Any help will be much appreciated.
Thanks

Hi @DAGBEMAMBOU : sorry for the troubles here. Builds for those packages (e.g. @dhis2-ui/field@9.15.0 should be available on npm). Here are a few ideas for things to check:

  • node version: make sure you’re using an up-to-date node version, e.g. v22 (some of the packages are not compatible with old versions of node)
  • try again. It’s possible that there was a temporary problem with npm.
  • try installing d2 cli with npm npm install --global @dhis2/cli (fyi docs for installation)
  • check that there’s no firewall preventing connection to npm

Let us know if any of those help or if you still run into issues!

Hi @tzemp
Many thanks for considering my concern.
Your advices were very helpful; the npm command successfully ran and d2 --version gave me 5.0.1.
Moving ahead with the installation, I launched the command
d2 cluster up 2.40.7 --db-version 2.40 --seed
which started running, but stopped and sent the following message:

Please find below the entire message sent:

Thanks in advancee for any help to solve this.
Regards

Hello everyone.
On my Ubuntu 22.04, when I launched the command
d2 cluster up 2.40.7 --db-version 2.40 --seed,
it did not fully excecute and I received the following message:

Thanks in advance for any help to solve this.
Regards

Glad to hear that you could get the d2 cli installed @DAGBEMAMBOU !

As for the docker issues, can you check which versions of docker and docker compose you have installed and let us know?

You may want to take a look at our documentation for running dhis2 in docker (DHIS2 in Docker | DHIS2 Developer Portal). The documentation also has some information on alternatives to using the d2 cli which might work better for you.

1 Like

Hi @tzemp
Thank you so much for your assistance.
my docker version is 26.1.3
my docker-compose version is 1.29.2
after installing docker, I re-lauched the command
d2 cluster up 2.40.7 --db-version 2.40 --seed
and I got the following message:

Thank you for any tip to help solve this.
Regards

Thanks for that information @DAGBEMAMBOU.

Could you take a look at this related post and see if the solution there works for you? (D2 cli not seeding appropriately [FIXED] - #3 by kpvandivier)

Hello @tzemp
Thank you so much for this insightful resource, but unfortunately, it didn’t work for me.
Since the shorthand flag p involved in the error message does not appear in the command d2 cluster up 2.40.7 --db-version 2.40 --seed I can’t understand the error message unknown shorthand flag: ‘p’ in -p
Thanks for any other tips which could help sort this out.
Regards

Sorry for the probelms, @DAGBEMAMBOU. We’re currently busy with some deadlines, so we unfortunately don’t have much time at the moment to help troubleshoot, but we will try look into this more on our side when we have a moment.

If you are primarily looking for a local instance, you might also want to try running docker from the dhis2-core repo (instructions here: GitHub - dhis2/dhis2-core: DHIS 2 Core. Written in Java. Contains the service layer and Web API.)

Maybe someone else from the community has some tips as well :folded_hands:

Hello @tzemp
Thank you so much for responding to me despite your very busy schedule.
While trying to run docker from the dhis2-core repo as you suggested,
I launched the command DHIS2_IMAGE=dhis2/core-dev:latest docker compose up
but, received the error message
docker: ‘compose’ is not a docker command.
Yet, I installed docker compose and the command
docker compose --version
gave Docker version 26.1.3, build 26.1.3-0ubuntu1~22.04.1
what can cause this error message, pls?
Thanks in advance for any help to fix that.
Regards.

This might be an Ubuntu/Docker issue. I saw this comment that suggests you need to run an additional install step for Ubuntu: `docker: 'compose' is not a docker command` when installing using convenience scripts · Issue #8630 · docker/compose · GitHub

Maybe you could try that? If that doesn’t work, I will also ask around to see if anyone on our dev team is running in Ubuntu and has any quick pointers.

@tzemp
Thank you so much; the ‘compose’ is not a docker command error is resolved.
The error I’m encountering now while trying to run the command
DHIS2_IMAGE=dhis2/core-dev:latest docker compose up
is no configuration file provided: not found
How to deal with this, pls?
Thanks in advance.

Note:
I would like to stress that I am using a WSL running Ubuntu

Have you cloned the dhis2-core repo and are you executing the command from that dhis2-core directory?

No, I didn’t;
If this is necessary, please share the link to the dhis2-core repo to clone.
Thanks

Eventually, I was able to find it’s link and clone the dhis2-core repo.
But, when I execute the command from the dhis2-core directory, I received the message below:
dockerdeamon_error

WARN[0000] /mnt/d/DHIS2/dhis2-core/dhis2-core/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Thanks in advance for any help to resolve this.
Please, note that I am using a WSL running ubuntu.

Hi @DAGBEMAMBOU

I’m really sorry to see that it has been such as hassle to get this working.

In your Docker Desktop, did you make sure to enable the WSL2 integration?

Additionally, are you able to find the list of containers… try both d2 cluster list and check the Docker Desktop containers list?

Hi @Gassim
Thank you so much for response.
I haven’t installed Docker Desktop yet; but while trying to install it as you mentioned it, I received the message that my version of Windows is not supported by Docker Desktop: is there any workaround?
Thanks in advance.
Regards

Hi @DAGBEMAMBOU

Sorry to hear that… which version of Windows are you using? You can run the command winver to find out which version you are using:

If there’s a chance, it might be a good idea to check if there are updates for your windows (or a newer version?)

I suspect that even if you’re not using Docker Desktop, if it isn’t compatible with your Windows version, there’s a chance the issues you’re seeing are related to this as well.

@Gassim
Thank you for taking the time to assist me.
Please find below my Windows version’s details.


This version is the latest one.
Thanks

1 Like

Hi @DAGBEMAMBOU

You are very close to the system requirement (Windows 10 64-bit: Minimum required is Home or Pro 22H2 (build 19045) ) but you have 19042.

You can check all the system requirements here: Windows | Docker Docs

Would you please check if there are updates available for your version. In your Windows Update settings, click on check for updates:

I hope that we’ll eventually have it launched and ready for you.

Thanks!