diff --git a/.npmrc b/.npmrc index f9ee8d53c1..6b59b846b5 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,3 @@ engine-strict=true -node-linker=hoisted \ No newline at end of file +node-linker=hoisted +script-shell=${TLON_SHELL-/bin/bash} diff --git a/CLAUDE.md b/CLAUDE.md index cd1ccfd577..fb48dc026a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -222,6 +222,19 @@ To identify which component to modify: - Builds on top of web application - Uses Electron for native desktop features +### Windows Development + +Several `package.json` scripts use Unix shell tools (`rm -rf`, `cp -R`, `mkdir -p`). `.npmrc` routes pnpm's `script-shell` through `${TLON_SHELL-/bin/bash}` so those scripts work everywhere: + +- **macOS/Linux**: nothing to do — `TLON_SHELL` is unset and pnpm falls back to `/bin/bash`. +- **Windows**: install [Git for Windows](https://git-scm.com/download/win), then point pnpm at its bash: + ```powershell + [System.Environment]::SetEnvironmentVariable("TLON_SHELL", "C:\Program Files\Git\bin\bash.exe", "User") + ``` + Open a fresh terminal so the env var is loaded. Do **not** rely on bare `bash` on PATH — on Windows it usually resolves to `C:\Windows\System32\bash.exe` (WSL), which runs scripts inside Linux with the wrong filesystem view. + +Also: use the pinned Node version (`.nvmrc` → 22.22.0). Node 24+ has no prebuilt binaries for `better-sqlite3@11.x` and will fall back to compiling via node-gyp, which needs VS Build Tools + Windows SDK installed. + ### Shell Script Compatibility When writing or modifying bash scripts, ensure compatibility with both macOS and Linux: diff --git a/apps/tlon-mobile/android/app/build.gradle b/apps/tlon-mobile/android/app/build.gradle index 3903c76d2c..680718a370 100644 --- a/apps/tlon-mobile/android/app/build.gradle +++ b/apps/tlon-mobile/android/app/build.gradle @@ -18,7 +18,8 @@ afterEvaluate { ) { description = "Bundle JS for TalkMessagingService" workingDir workspaceRoot - commandLine "pnpm", "run", "--filter", "scripts", "build" + def pnpmExe = org.gradle.internal.os.OperatingSystem.current().isWindows() ? "pnpm.cmd" : "pnpm" + commandLine pnpmExe, "run", "--filter", "scripts", "build" } def copyTask = tasks.create( name: "copyNotificationServiceJsBundle",