fix(cli): configure Windows PATH and bin shims on global npm install - #430
Open
m-golovchin wants to merge 11 commits into
Open
fix(cli): configure Windows PATH and bin shims on global npm install#430m-golovchin wants to merge 11 commits into
m-golovchin wants to merge 11 commits into
Conversation
added 11 commits
July 21, 2026 13:47
…binary engineBin is already a fully-resolved absolute path from where/which, so shell:true is unnecessary and re-splits paths containing spaces (e.g. "C:\Program Files\Docker\...") into invalid commands on Windows.
…ilable CR-001: runWindows()'s dynamic import and its calls were unguarded, so a missing dist/ (e.g. Windows CI's npm ci step running before dist/ is downloaded, or a fresh clone before npm run build) crashed postinstall with an uncaught rejection instead of degrading like every other non-actionable failure mode.
Technical analysis, complexity assessments (initial + actual), spec, plan, code review verdicts, and QA report for the npm Windows PATH fix.
…tern - Remove #!/usr/bin/env node from postinstall.mjs; Vite SSR transform prepends generated code pushing the hashbang past position 0, causing SyntaxError in all 27 postinstall tests - Migrate vitest.config.ts from deprecated poolOptions.threads to top-level maxWorkers/minWorkers (Vitest 4.x breaking change) - Double-quote ESLint glob patterns; single-quoted brace expansion fails on Windows cmd.exe, unquoted ** only expands one level deep on Unix sh EPMCDME-13191
m-golovchin
force-pushed
the
fix/npm-windows-path-shims
branch
from
July 21, 2026 10:49
8d22d0c to
4033405
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
npm install -g @codemieai/codeon Windows not adding PATH entries or creating bin shims.Adds a
postinstall.mjsscript that runs after installation and:/binsuffix unlike Unix)addToUserPathfromdist/utils/windows-path.js).cmdfiles) are missingdist/utils/windows-path.jsis not built yet~/.zshrc,~/.bash_profile, or~/.bashrcAlso includes supporting tooling fixes discovered during test development:
#!/usr/bin/env nodehashbang frompostinstall.mjs— Vite SSR transform prepends generated code before the file, pushing the hashbang past position 0 and causingSyntaxErrorin all unit testsvitest.config.tsfrom deprecatedpoolOptions.threads.{maxThreads,minThreads}to top-levelmaxWorkers/minWorkers(Vitest 4.x)package.json; single-quoted brace expansion fails on Windowscmd.exe, and unquoted**only expands one level deep on UnixshChanges
scripts/postinstall.mjs— Windows PATH + shim diagnostic implementation (27 unit tests inscripts/__tests__/postinstall.test.ts)scripts/postinstall.mjs— remove hashbang; fix isMain guardvitest.config.ts— Vitest 4 poolOptions migrationpackage.json— cross-platform ESLint glob fixTesting
npm run check:pre-commitpasses (typecheck + lint clean)codemie --versionresolves after freshnpm install -g, PATH set in registry, all.cmdshims presentChecklist
mainCloses EPMCDME-13191