fix(#2249): correct macOS Node, Python and CouchDB steps in dev guide - #2250
Conversation
…guide Five steps in the CHT Core dev environment guide fail when followed on macOS. node@22 is keg-only, so the macOS `brew install` never puts Node 22 on the PATH, and the `node -v && npm -v` check reports the pre-existing version without signalling that the step it verifies did not work. Adds the PATH export and gives the check an explicit failure branch. pyenv is pinned to 2.7.18 in two places, but nothing in cht-core uses Python 2: haproxy-healthcheck runs `python3 -m venv` and its .tool-versions declares python 3.10.13. Repins to that version. `docker stop medic-couchdb` names a container the guide's own compose file never creates (it creates cht-docker-couchdb-1 and cht-docker-nouveau-1), so it fails with "No such container". Replaces stop and start with the compose equivalents, which need the COUCHDB_* prefix because the compose file marks COUCHDB_PASSWORD mandatory. Also fixes a malformed markdown link on the bzip2 prerequisite. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mrjones-plip
left a comment
There was a problem hiding this comment.
Thanks for the improvements! As I mentioned, new eyes make all bugs shallow ;)
requesting some small tweaks, but overall looks good.
There was a problem hiding this comment.
Let's get a fix from another PR in your PR - thanks!
| sudo apt -y install xsltproc curl uidmap jq python3 git make bzip2 |
There was a problem hiding this comment.
Let's get a fix from another PR in your PR - thanks!
| sudo apt -y install xsltproc curl uidmap jq python3 git make bzip2 |
| * [Docker](https://docs.docker.com/engine/install/) | ||
| * [CouchDB](https://docs.couchdb.org/en/stable/install/index.html) - OS package instead of in Docker - you **MUST** use CouchDB 2.x for CHT < 4.4! We still strongly recommend using Docker. | ||
| * [bzip2])(https://sourceware.org/bzip2/downloads.html) - if you're on Ubuntu call: `sudo apt install bzip2` | ||
| * [bzip2](https://sourceware.org/bzip2/downloads.html) - if you're on Ubuntu call: `sudo apt install bzip2` |
There was a problem hiding this comment.
let's just explicitly add it per my other suggestion. then we can just remove this line and broken link:
| * [bzip2](https://sourceware.org/bzip2/downloads.html) - if you're on Ubuntu call: `sudo apt install bzip2` |
| ``` | ||
|
|
||
| {{< callout type="warning" >}} | ||
| On macOS, `node@{{< param nodeVersion >}}` is [keg-only](https://docs.brew.sh/FAQ#what-does-keg-only-mean) — installing it does not put it on your PATH. If the command above reports any version other than {{< param nodeVersion >}}.x.x, the `export PATH` line from the macOS tab has not taken effect; open a new shell, or re-run it, before continuing. Everything below will otherwise silently build and run against the wrong version of Node. |
There was a problem hiding this comment.
Fair point about keeping this in-line as it doesn't silently fail (er, "fail"? I suspect it works against latest LTS node 🤷 ). Let's keep it here but snug up the wording:
| On macOS, `node@{{< param nodeVersion >}}` is [keg-only](https://docs.brew.sh/FAQ#what-does-keg-only-mean) — installing it does not put it on your PATH. If the command above reports any version other than {{< param nodeVersion >}}.x.x, the `export PATH` line from the macOS tab has not taken effect; open a new shell, or re-run it, before continuing. Everything below will otherwise silently build and run against the wrong version of Node. | |
| On macOS, `node@{{< param nodeVersion >}}` is [keg-only](https://docs.brew.sh/FAQ#what-does-keg-only-mean) so it doesn't end up in your `PATH`. If `node -v` shows a different version than {{< param nodeVersion >}}.x.x, the `export PATH` line from the macOS tab has not taken effect. To fix this, open a new shell, or re-run `export PATH`, before continuing. |
…rerequisite line, tighten keg-only wording Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E3pPDjTvWBhxAKKCQdSwcn
There was a problem hiding this comment.
Thanks @ken-talltree-io ! Is a much improved document for macOS users thanks to you .
Looking at it in the fully rendered site, the MacOS warning was a bit too out of place, looking like it was possibly in the Linux or WSL2 instructions, so I moved inside the MacOS tab group and a "in the command below"
Description
Fixes #2249
Five steps in the CHT Core dev environment guide are wrong on macOS. I hit all five following the guide end to end today on macOS 26.3.1 (Apple Silicon); each fix is one I ran rather than reasoned about.
1.
node@{{< param nodeVersion >}}is keg-only, so the install step doesn't take effect. Homebrew does not symlink keg-only formulae onto the PATH, so after the macOS tab'sbrew install,nodeis still whatever it was before. Adds theexport PATHline, and gives thenode -v && npm -vverification an explicit failure branch — as written it prints the wrong version and reports nothing wrong, so the reader goes on to build and run everything against the wrong Node.2 & 3.
pyenv global 2.7.18pins an EOL Python the repo cannot use, in the macOS tab and again in the prerequisites list. The only Python tooling incht-coreishaproxy-healthcheck/, whoseMakefilerunspython3 -m venv .venvand whose.tool-versionsdeclarespython 3.10.13. The Linux and WSL2 tabs of this same guide installpython3.4.
docker stop medic-couchdbnames a container that is never created. Thedocker-compose.ymlthis guide downloads createscht-docker-couchdb-1andcht-docker-nouveau-1, so the documented command fails withNo such container, and correcting only the name would still leavenouveaurunning. Replaces stop and start with the compose equivalents. They need theCOUCHDB_*prefix because the compose file marksCOUCHDB_PASSWORDmandatory with:?— without itdocker composeaborts during interpolation.5. Malformed markdown link on the
bzip2prerequisite —])(should be](.How this was verified
node@22is keg-onlybrew info node@22→[keg-only], "was not symlinked into /opt/homebrew"node -vreported 26.4.0, not 22.x.xpython2absent from the machine;npm ci(3439 pkgs),npm run build-devandnpm run dev-apiall completed clean.tool-versionsasks for 3.10.13haproxy-healthcheck/.tool-versionsdocker stop medic-couchdbfailsError response from daemon: No such container: medic-couchdbdocker compose stopfailsrequired variable COUCHDB_PASSWORD is missing a valuestop→ both containersExited (143)→start→ bothUp→ CouchDB answering on 5984callout type="warning"renderscallout typealready used in three othercontent/enpagesNot in this PR
#2249 also lists six improvements — a
.envfor the CouchDB credentials, a link to the automated-tests page, a note about the hardcoded~/cht-corepaths, where the CouchDB data lives, a question about| $SHELLin the Linux nvm install, and the missing.nvmrcin cht-core. I've deliberately kept them out of this PR so the fixes can land on their own. Happy to add any of them here or in a follow-up — your call.What I did not verify
Only the macOS path. I have no Linux or WSL2 machine, so I have not confirmed those tabs are unaffected — I believe they are, since neither uses Homebrew or
pyenv. I also did not run the e2e or integration suites, so the Python 2 claim is scoped to the setup this guide walks through rather than to the whole repo. I have not built the site locally to view the rendered page.AI disclosure
Claude Code (Anthropic) was used to run the setup, reproduce each failure, test the replacement commands, and draft this PR. Every command in the table above was executed and its output read. I have reviewed the change and am accountable for it. — Ken Britton
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.