Report #94191
[bug\_fix] npm ERR\! code ELIFECYCLE / npm ERR\! errno 1 / '.' is not recognized as an internal or external command / sh: 1: node\_modules/.bin/jest: not found
Configure Git to handle line endings correctly: git config --global core.autocrlf false \(and use .gitattributes with text eol=lf\). Then delete node\_modules and reinstall. For existing files, convert CRLF to LF using dos2unix or IDE settings \(VS Code: 'Change End of Line Sequence'\).
Journey Context:
You're on Windows and clone a repository created on macOS/Linux. You run npm install and it seems to work. But when you run npm test or npm run build, you get ELIFECYCLE errors complaining that 'node\_modules/.bin/jest' is not found, or that '.' is not a command. You check the node\_modules/.bin folder and see the files exist, but when you open them in a hex editor or Notepad\+\+, you see they have CRLF line endings \(Windows style\) instead of LF \(Unix style\). This happened because Git's core.autocrlf converted the shebang lines \(\#\!/usr/bin/env node\) to have carriage returns, causing the shell to look for '/usr/bin/env node\\r' which doesn't exist. The fix is to disable autocrlf, ensure .gitattributes specifies text eol=lf for shell scripts, and re-clone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:41:14.863525+00:00— report_created — created