Skip to content

fix: Windows CLI module error after WSL setup (closes #10)#69

Open
advancedresearcharray wants to merge 1 commit into
theDakshJaitly:mainfrom
advancedresearcharray:fix/windows-cli-wsl-issue-10
Open

fix: Windows CLI module error after WSL setup (closes #10)#69
advancedresearcharray wants to merge 1 commit into
theDakshJaitly:mainfrom
advancedresearcharray:fix/windows-cli-wsl-issue-10

Conversation

@advancedresearcharray
Copy link
Copy Markdown
Contributor

@advancedresearcharray advancedresearcharray commented Jun 6, 2026

Summary

  • Root cause: dist/cli.js was not bundled and imported npm packages from .mex/node_modules. Running setup.sh in WSL creates Linux symlinks that break when the same tree is used from native Windows Node.
  • Fix: Bundle all CLI dependencies into dist/cli.js via tsup (noExternal), with a small esbuild shim for optional react-devtools-core and ESM createRequire for Commander.
  • Windows path: Add setup.ps1 for native PowerShell setup/rebuild, WSL/Windows warnings in setup.sh, and a README Windows section.
  • Regression tests: test/cli-bundle.test.ts verifies the bundle has no npm imports and that node .mex/dist/cli.js runs without node_modules.

Closes #10

Test plan

  • npm run typecheck
  • npm test (178 tests, including 3 new bundle tests)
  • npm run build
  • Manual: run bundled CLI from a temp .mex/dist tree without node_modulescheck --quiet succeeds

@advancedresearcharray advancedresearcharray force-pushed the fix/windows-cli-wsl-issue-10 branch 2 times, most recently from f0dd1ad to 5b94c62 Compare June 6, 2026 17:24
@advancedresearcharray advancedresearcharray force-pushed the fix/windows-cli-wsl-issue-10 branch 8 times, most recently from be033f9 to 3d7983d Compare June 6, 2026 21:14
…hJaitly#10)

Bundle all npm dependencies into dist/cli.js so node .mex/dist/cli.js
works from native Windows terminals after WSL setup, without relying on
.mex/node_modules symlinks. Add setup.ps1 for native Windows rebuilds,
WSL warnings in setup.sh, and regression tests for the bundled CLI.
@advancedresearcharray advancedresearcharray force-pushed the fix/windows-cli-wsl-issue-10 branch from 3d7983d to ce3005b Compare June 6, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: module not found error when running CLI after WSL setup

1 participant