From e4e2e217df30800a5c3fec9632bed7223d5f59e7 Mon Sep 17 00:00:00 2001 From: Predrag Radenkovic Date: Wed, 29 Jul 2026 17:25:33 +0200 Subject: [PATCH 1/2] Skip plain-forge install when Node.js is unavailable The npx presence check passes when a version-manager shim (nvm, volta, asdf) is on PATH without a working Node.js behind it. The npx call then fails and aborts the whole installer: set -euo pipefail in bash, ErrorActionPreference=Stop in PowerShell. The PowerShell installer also marked plain-forge as installed even when the npx command failed. Verify node actually runs before invoking npx, skip the step with a clear message when it doesn't, and let a failed plain-forge install print a retry hint instead of aborting the remaining setup steps. The final next-steps screen already reminds the user to install plain-forge manually whenever the step was skipped or failed. --- install/bash/install.sh | 16 ++++++++++++---- install/powershell/install.ps1 | 31 +++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/install/bash/install.sh b/install/bash/install.sh index 72b55a93..75acf7cb 100755 --- a/install/bash/install.sh +++ b/install/bash/install.sh @@ -312,12 +312,20 @@ fi PLAIN_FORGE_INSTALLED=false if [[ ! "${INSTALL_PLAIN_FORGE:-}" =~ ^[Nn]$ ]]; then - if command -v npx &> /dev/null; then - npx plain-forge install < /dev/tty - PLAIN_FORGE_INSTALLED=true + # A stale nvm/volta/asdf shim can make npx resolvable without a working + # Node.js behind it, so verify node actually runs before invoking npx. + if command -v npx &> /dev/null && node --version &> /dev/null; then + # The install must not abort the rest of the setup if plain-forge + # fails (set -e is active), so run it inside the condition. + if npx plain-forge install < /dev/tty; then + PLAIN_FORGE_INSTALLED=true + else + echo -e "${GRAY}plain-forge installation failed. You can retry later with:${NC}" + echo -e " npx plain-forge install" + fi echo "" else - echo -e "${GRAY}npx not found. Install Node.js, then run:${NC}" + echo -e "${GRAY}Node.js not found. Skipping plain-forge. Install Node.js, then run:${NC}" echo -e " npx plain-forge install" echo "" fi diff --git a/install/powershell/install.ps1 b/install/powershell/install.ps1 index 0ac18e80..fe3b791d 100644 --- a/install/powershell/install.ps1 +++ b/install/powershell/install.ps1 @@ -347,12 +347,35 @@ if ($nonInteractive) { $plainForgeInstalled = $false if ($installPlainForge -notmatch '^[Nn]$') { - if (Get-Command npx -ErrorAction SilentlyContinue) { - npx plain-forge install - $plainForgeInstalled = $true + # A stale version-manager shim can make npx resolvable without a working + # Node.js behind it, so verify node actually runs before invoking npx. + $nodeWorks = $false + if ((Get-Command node -ErrorAction SilentlyContinue) -and (Get-Command npx -ErrorAction SilentlyContinue)) { + try { + & node --version *> $null + $nodeWorks = ($LASTEXITCODE -eq 0) + } catch { + $nodeWorks = $false + } + } + if ($nodeWorks) { + # A plain-forge failure must not abort the rest of the setup + # ($ErrorActionPreference is 'Stop'). + try { + npx plain-forge install + if ($LASTEXITCODE -eq 0) { + $plainForgeInstalled = $true + } + } catch { + # fall through to the retry hint below + } + if (-not $plainForgeInstalled) { + Write-Host "${GRAY}plain-forge installation failed. You can retry later with:${NC}" + Write-Host " npx plain-forge install" + } Write-Host "" } else { - Write-Host "${GRAY}npx not found. Install Node.js, then run:${NC}" + Write-Host "${GRAY}Node.js not found. Skipping plain-forge. Install Node.js, then run:${NC}" Write-Host " npx plain-forge install" Write-Host "" } From 39623913cb2727b754dcab5902b962a4c0012c54 Mon Sep 17 00:00:00 2001 From: Predrag Radenkovic Date: Thu, 30 Jul 2026 09:54:13 +0200 Subject: [PATCH 2/2] Explain why plain-forge is skipped when Node.js is missing The bare "Node.js not found" line read like a status report and did not say what plain-forge is or why Node.js matters. Explain that plain-forge brings codeplain's agentic skills to the user's coding agent, that installing it requires Node.js, and how to add it later. --- install/bash/install.sh | 7 +++++-- install/powershell/install.ps1 | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/install/bash/install.sh b/install/bash/install.sh index 75acf7cb..e8cb2be2 100755 --- a/install/bash/install.sh +++ b/install/bash/install.sh @@ -325,8 +325,11 @@ if [[ ! "${INSTALL_PLAIN_FORGE:-}" =~ ^[Nn]$ ]]; then fi echo "" else - echo -e "${GRAY}Node.js not found. Skipping plain-forge. Install Node.js, then run:${NC}" - echo -e " npx plain-forge install" + echo -e " ${GRAY}plain-forge brings codeplain's agentic skills to your coding agent,${NC}" + echo -e " ${GRAY}but installing it requires Node.js, which was not found on this machine.${NC}" + echo "" + echo -e " ${GRAY}If you want it, install Node.js and then run:${NC}" + echo -e " ${WHITE}${BOLD}npx plain-forge install${NC}" echo "" fi fi diff --git a/install/powershell/install.ps1 b/install/powershell/install.ps1 index fe3b791d..8c96e0ca 100644 --- a/install/powershell/install.ps1 +++ b/install/powershell/install.ps1 @@ -375,8 +375,11 @@ if ($installPlainForge -notmatch '^[Nn]$') { } Write-Host "" } else { - Write-Host "${GRAY}Node.js not found. Skipping plain-forge. Install Node.js, then run:${NC}" - Write-Host " npx plain-forge install" + Write-Host " ${GRAY}plain-forge brings codeplain's agentic skills to your coding agent,${NC}" + Write-Host " ${GRAY}but installing it requires Node.js, which was not found on this machine.${NC}" + Write-Host "" + Write-Host " ${GRAY}If you want it, install Node.js and then run:${NC}" + Write-Host " ${WHITE}${BOLD}npx plain-forge install${NC}" Write-Host "" } }