Skip to content

codev doctor: warn on native Windows when npm or pnpm script-shell is not set to Git Bash #1945

Open

Description

@amrmelsayed

Problem

On native Windows, npm and pnpm run package scripts through the Windows command prompt unless script-shell is set. A package script that names a POSIX shell script then fails with a message that points nowhere near the cause:

'scripts' is not recognized as an internal or external command

This repository's root build script starts with scripts/check-main-fresh.sh, so the failure hits pnpm build, pnpm local-install, and porch's build check (porch runs the check in Git Bash, but npm then starts the package script in its own shell).

npm and pnpm store the setting separately. On 2026-11-23 a Node reinstall reset npm's value while pnpm's survived, and a builder's porch done failed its build check in under a second for that reason. The same error cost time twice more earlier in the week.

codev doctor checks nothing about script-shell today.

Fix

  1. codev doctor, on native Windows only: read script-shell for npm and for pnpm (whichever of the two is installed). When either is unset or does not point at an existing Git Bash, report a warning, not a failure, and print the exact command to set it for that tool, using the Git Bash path doctor already resolves.

    A warning because an unset value only breaks projects whose package scripts need a POSIX shell; an adopter whose scripts run under the command prompt is not broken.

  2. Correct the "Native Windows" note added to the codev skill in docs: note for running the repo's pnpm scripts on native Windows #1918 (all copies). It names only pnpm's setting; it should say npm needs the same one and why (porch's checks call npm).

Verification

  • Unit tests for the doctor check with the config lookups injected: both set, npm unset, pnpm unset, a value pointing at a missing file, one tool not installed, and a non-Windows platform (check skipped).
  • Manual on native Windows: unset npm's value, run codev doctor, see the warning and the command; set it, see it clear.
  • The skill copies stay identical to each other.

Out of scope

Having porch pass the setting to npm itself when it runs a check, so builders do not depend on machine configuration. That changes behaviour for adopters whose scripts assume the command prompt and needs its own decision.

Activity

  1. added
    area/core
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions