KKIMS on-site docs
Your workstation

Windows notes

Everything Windows-specific learned on this project - App Control blocking kind, Helm and Node's native modules, Constrained Language Mode, red stderr, line endings, npm run dev and the site build on Windows, Git Bash for shell scripts, path length, the local Jenkins workspace, and harmless messages.

Everything specific to Windows that came up on this project, mostly on the engineer's Windows 11 laptop in November 2026. Read it before you start if you are on Windows. Linux and macOS users can skip it.

Most of this concerns your laptop (the local rehearsal and the hand-over tools). KIMS's EKS nodes and Jenkins agent are Linux; nothing here applies to them, except where a file is written on Windows and carried to Linux (line endings).

Note

A few fixes for Windows live on the windows-fixes branch of kims-v2, which is not merged into main. Where a note depends on one, it says so in a warning, with what happens on main without it. KIMS's infrastructure never needs that branch.

#The shells

#PowerShell by default, Git Bash for shell scripts

Run commands in PowerShell unless a block is labelled bash; then use Git Bash (from Git for Windows). Git Bash is needed for the repository's .sh scripts (deploy/kind/up.sh, down.sh), for openssl, and for the dev servers below. Which shell to use has the full list and an equivalents table.

#PowerShell shows success in red

git, kubectl, npm, helm and the migration runner write progress to stderr. Windows PowerShell 5.1 colours stderr red and may wrap it in NativeCommandError, so a successful git push can look like a failure. Judge by the last line of output and by $LASTEXITCODE (0 means it worked).

#Constrained Language Mode

On the engineer's managed laptop PowerShell ran in Constrained Language Mode. Check yours:

powershell
$ExecutionContext.SessionState.LanguageMode

FullLanguage is unrestricted. ConstrainedLanguage means:

  • Calls into .NET ([Convert]::ToBase64String, [System.Security.Cryptography...], [Environment]::SetEnvironmentVariable) fail with Method invocation is supported only on core types in this language mode.
  • Unsigned .ps1 scripts, including install scripts piped to iex, may be blocked.

The way round, used throughout this site: do it in Git Bash (openssl, base64, read -rs), use an MSI rather than an install script, and use Node for anything scripted. That is why the engineer's helper deploy.mjs is written in Node with no dependencies.

#Git Bash rewrites paths

Git Bash turns arguments that look like /repo into C:/Program Files/Git/repo before Docker or kubectl sees them. Run such commands in PowerShell, or prefix them with MSYS_NO_PATHCONV=1. Seen with docker compose exec jenkins git ls-remote -- file:///repo.

#App Control

#What it is

Windows App Control for Business (formerly Windows Defender Application Control) and its consumer form Smart App Control block programs and libraries that are not signed by a trusted publisher or known to Microsoft's reputation service. A managed laptop may enforce a policy set by IT. The message is:

text
An Application Control policy has blocked this file.

(Git Bash says Permission denied for the same block.) Blocks are logged in Event Viewer under Applications and Services Logs, Microsoft, Windows, CodeIntegrity, Operational. To list the latest:

powershell
Get-WinEvent -LogName "Microsoft-Windows-CodeIntegrity/Operational" -MaxEvents 20 | Format-List TimeCreated, Id, Message

You cannot switch it off yourself on a managed laptop, and should not try: ask IT to allow the specific files.

#App Control and kind, Helm

winget installs kind.exe and helm.exe under %LOCALAPPDATA%\Microsoft\WinGet\Packages\, and they are not signed. On 2026-11-28 App Control blocked both until IT allowed them the same day. The files were:

  • kind.exe under ...\WinGet\Packages\Kubernetes.kind_Microsoft.Winget.Source_8wekyb3d8bbwe\
  • helm.exe under ...\WinGet\Packages\Helm.Helm_Microsoft.Winget.Source_8wekyb3d8bbwe\windows-amd64\

Give IT each file's path and hash:

powershell
Get-ChildItem "$env:LOCALAPPDATA\Microsoft\WinGet\Packages" -Recurse -Include kind.exe, helm.exe | Get-FileHash -Algorithm SHA256

A hash rule breaks on every upgrade; a path rule for a folder of your own tools (for example C:\Users\<you>\bin) lasts, if IT allows it.

#App Control and Node's native modules

Some npm packages ship compiled .node files. Next.js (the CMS, the website, every build), the tests and lint need them, and App Control can block them because they are unsigned. After npm install, from the repo, check each one in PowerShell:

powershell
node -e "require('./node_modules/@next/swc-win32-x64-msvc/next-swc.win32-x64-msvc.node'); console.log('ok')"
powershell
node -e "require('./node_modules/@rollup/rollup-win32-x64-msvc/rollup.win32-x64-msvc.node'); console.log('ok')"
powershell
node -e "require('./node_modules/@unrs/resolver-binding-win32-x64-msvc/resolver.win32-x64-msvc.node'); console.log('ok')"

You should see ok after each. These three were allowed on the engineer's laptop on 2026-11-26. An npm install that upgrades these packages changes the files, so a hash rule stops matching: check again after any upgrade. A path rule for node_modules under your development folder avoids this, if IT allows it.

The image-processing library sharp also ships native files (@img/sharp-win32-x64); it is used only by the worker and the media import. If it is blocked, image resizing fails locally and nothing else.

#Harmless: the rollup gnu message

You may see rollup.win32-x64-gnu.node fail to load (it needs MinGW libraries that are not installed). Nothing is wrong: Rollup uses the msvc build on Windows, which is the one checked above.

#Running the apps on Windows

#npm run dev does not work on Windows

npm run dev runs scripts/dev.mjs, which starts npm with Node's spawn and no shell; on Windows npm is npm.cmd, which that cannot start. The website's own dev script also uses Unix-only syntax (KIMS_INCLUDE_INTERNAL=1 ... next dev). So run each app in its own Git Bash window, from the repo, and leave each open.

The CMS (port 3101):

bash
cd apps/cms && set -a && . ../../.env.local && set +a && node ../../node_modules/next/dist/bin/next dev --port 3101

The website (port 3100), reading the content exported for it:

bash
cd apps/website && KIMS_INCLUDE_INTERNAL=1 KIMS_CONTENT_ROOT=../../.local-content node ../../node_modules/next/dist/bin/next dev --port 3100

The worker (without it, Publish only queues and image sizes never appear):

bash
cd apps/cms && node --env-file-if-exists=../../.env.local --conditions=react-server --import tsx ../worker/src/main.ts dev

You should see Ready and the Local: address for the two apps, and a log line with "message":"worker started" for the worker. The apps on the host has the full local procedure, including preparing .local-content.

#The local site build on Windows

Warning

Needs the windows-fixes commits, not yet merged into main. On main, npm run site:build fails on Windows at the first stage that starts npm or npx (spawnSync npm ENOENT, or EINVAL, reported as "exit null"), because Node cannot start npm.cmd or npx.cmd without a shell. windows-fixes (commit 05ef85a) runs npm's and Next's own scripts with Node instead. On main, run the local site build in WSL or on Linux or macOS, or in the local Jenkins container (which is Linux).

The same branch adds --from-stage <stage> to resume a long build at a later stage (for example --from-stage bundle-media) after a failure, and KIMS_BUILD_WORKERS to cap Next's static-generation workers. Neither exists on main.

#Keep the dev servers listening on IPv4

Locally, Keycloak (in Docker) calls the CMS's back-channel logout at host.docker.internal:3101, which Docker Desktop delivers to 127.0.0.1. A CMS started with --hostname localhost may listen on [::1] only and never receive the call, so local sign-outs then take up to 5 minutes. The commands above bind every interface, which works; if you choose one, use --hostname 127.0.0.1.

#A port is already in use

powershell
Get-NetTCPConnection -LocalPort 3101 -State Listen | Select-Object OwningProcess
Get-Process -Id <PID>

Stop that process (Ctrl+C in its window, or Stop-Process -Id <PID>).

#Files, paths and line endings

#Extracting the handover zip

Use Windows's own C:\Windows\System32\tar.exe from PowerShell:

powershell
C:\Windows\System32\tar.exe -xf content-latest.zip

Explorer's "Extract all" adds an extra folder level, which pushed some paths past Windows's 260-character limit and failed with "path too long". Git Bash's tar cannot read zip files. Get the code has the full step.

#Long paths

Turn long paths on in Windows and in git, and keep your working folder short (C:\kims rather than a deep path under Documents). Git has the commands.

#Line endings

The repository forces LF for shell scripts (.gitattributes), so a Windows checkout cannot produce a script Linux cannot run. With core.autocrlf=true, some other files may show as modified with only line-ending changes (seen with packages/db/src/cli.ts): check with git diff --ignore-cr-at-eol and do not commit them. Git explains.

Files you write on Windows and hand to Linux need care:

  • Helm values and pod specs: save as UTF-8 with LF. YAML with CRLF usually parses, but a UTF-16 file (what PowerShell 5.1's > writes) does not.
  • The kims-site-env credential: the site build job drops carriage returns, so a file saved on Windows works. Still save it as UTF-8.
  • Anything a shell runs: must be LF.

#PowerShell 5.1 writes UTF-16

>, >> and Out-File in Windows PowerShell 5.1 write UTF-16 with a byte-order mark. kubectl, Helm, the AWS CLI and Node cannot read it as YAML or JSON. Use Set-Content -Encoding ascii (or -Encoding utf8 in PowerShell 7) or save from an editor. See Which shell to use.

#Docker Desktop on Windows

#Give WSL enough memory

With the WSL 2 backend, Docker's memory is WSL's, set in C:\Users\<you>\.wslconfig ([wsl2], memory=8GB), then wsl --shutdown. See Docker.

#The local Jenkins workspace

Warning

Needs the windows-fixes commits, not yet merged into main. On main, local/docker-compose.yml mounts the local Jenkins's build workspace from a Windows folder (.local-jenkins-workspace). On that bind mount a full site build spent most of 90 minutes on file I/O (npm ci, Next's write-out, the locale merge) and timed out. windows-fixes (commit 73cd4f7) puts the workspace on a Docker volume (kims-v2_jenkins-workspace, about 10 GB needed) and sets KIMS_BUILD_WORKERS=3 so the export fits Docker Desktop's memory (with eleven workers it died with ENOMEM). On main on Windows, expect the local Jenkins site build to be very slow or time out; the local site build without Jenkins, or a Linux or macOS machine, avoids it.

To look at a build's output when the workspace is a volume, copy it out of the container first (docker cp). Local Jenkins has the commands.

#The kind rehearsal: sign-in and uploads

Warning

Needs the windows-fixes commits, not yet merged into main. Two fixes make sign-in and media uploads work in the local kind rehearsal (on every OS, not only Windows): a Keycloak proxy in the CMS pod so a localhost issuer works from inside the cluster, with the CMS on http://localhost:3102 (commit a502528), and S3_PUBLIC_ENDPOINT so presigned upload URLs are signed for the address the browser uses (commit 188d574). On main, the kind CMS starts and passes its health check, but signing in fails (it cannot reach localhost:8180 from the pod) and uploads fail. See Local Kubernetes.

#When Docker Desktop is stuck

Containers stuck at Created, or docker commands hanging: restart Docker Desktop from its tray icon, or wsl --shutdown and start it again. An error mentioning dockerDesktopLinuxEngine only means it is not running yet. Docker.

#Installing tools

#New programs are not found until you open a new window

winget and MSI installers change PATH for new windows only. The install ends with Path environment variable modified; restart your shell to use the new value. Close every PowerShell window, including those inside your editor, and open a new one. If a program is still not found, sign out of Windows and in again.

#winget and the versions you need

winget installs the newest by default, which is wrong for two tools here. Pin them:

Tool Command Why
Node.js winget install -e --id OpenJS.NodeJS.LTS --version 24.22.3, then winget pin add --id OpenJS.NodeJS.LTS Latest LTS is 26; the project needs 24 (Node)
Helm winget install -e --id Helm.Helm --version 3.22.1, then winget pin add --id Helm.Helm Latest is Helm 4; the chart is tested on 3 (kubectl and Helm)

#Antivirus and npm install

Real-time antivirus scanning of node_modules (tens of thousands of small files) can make npm install and builds several times slower. If IT allows it, an exclusion for your development folder helps. Do not add one yourself on a managed laptop.

#Quick reference: Windows problems and fixes

What you see Cause Fix
An Application Control policy has blocked this file App Control App Control: give IT path and hash
Red NativeCommandError after git push or kubectl stderr in PowerShell Check the last line and $LASTEXITCODE
Method invocation is supported only on core types in this language mode Constrained Language Mode Git Bash or an MSI
npm run dev fails Not supported on Windows Run each app in Git Bash
spawnSync npm ENOENT / EINVAL / "exit null" in npm run site:build main cannot start npm.cmd / npx.cmd Needs windows-fixes; or build in WSL, Linux or macOS
rollup.win32-x64-gnu.node fails to load Unused gnu build Ignore
"path too long" extracting Explorer's "Extract all" tar.exe
tar: Error opening archive in Git Bash Git Bash's tar and zip files C:\Windows\System32\tar.exe in PowerShell
kind / helm not recognized after install Old window New window, or sign out and in
git status lists files you did not touch Line endings git diff --ignore-cr-at-eol
A YAML or JSON file is "invalid" but looks fine Written as UTF-16 by PowerShell 5.1 Rewrite as UTF-8
Docker errors mention dockerDesktopLinuxEngine Docker Desktop not running Start it and wait
Local Jenkins site build times out Workspace on a Windows bind mount (main) Needs windows-fixes; see The local Jenkins workspace
A path like C:/Program Files/Git/repo in an error Git Bash path conversion MSYS_NO_PATHCONV=1 or PowerShell

#Sources

Built 2026-11-29. Commands are shown for the system picked at the top; every block has all three.