Skip to content

fix: make npm run dev and check-format work on Windows - #35

Open
Chebaleomkar wants to merge 2 commits into
CopilotKit:mainfrom
Chebaleomkar:fix/windows-dev-setup
Open

Chebaleomkar wants to merge 2 commits into
CopilotKit:mainfrom
Chebaleomkar:fix/windows-dev-setup

Conversation

@Chebaleomkar

Copy link
Copy Markdown

Fixes #34

Problem: on a fresh Windows clone, npm run dev exits with 'NODE_ENV' is not recognized, and npm run check-format reports 121 files, because Git checks them out with CRLF line endings.

Fix

  • Add .gitattributes (* text=auto eol=lf) so text files are checked out with LF. The files in the repository are already LF, so renormalizing changes no files.
  • Run the dev script's server command through cross-env (new devDependency) so NODE_ENV=development works in cmd.exe. The lockfile only adds cross-env and its one dependency.

No setup docs change: the commands stay the same.

Testing (Windows 11, Node 24.14.0)

  • Re-checked out the tree with the new attributes, and npm run check-format passes.
  • npm run dev: the server logs listening on http://127.0.0.1:4310, Vite serves on 5173, and /api requests proxy through.
  • npm ci, lint, typecheck, test (156/156) and build all pass.

Windows clones with core.autocrlf=true get CRLF files, so
npm run check-format fails on every file under Prettier's
default endOfLine: lf.
cmd.exe cannot parse inline NODE_ENV=development, so npm run dev
exits immediately on Windows. Use cross-env.
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.

Fresh Windows clone: npm run dev and npm run check-format fail

1 participant