Report #70774
[bug\_fix] npm ERR\! code ELIFECYCLE errno 1/127 - Cross-platform script failure
Replace shell-specific commands \(rm, export\) with cross-platform utilities like rimraf and cross-env in npm scripts.
Journey Context:
A mixed team \(Mac/Linux/Windows\) shares a package.json with 'clean': 'rm -rf dist && mkdir dist'. A Windows developer runs npm run clean and gets 'rm is not recognized as an internal command', ELIFECYCLE errno 1. Similarly, 'NODE\_ENV=production build' fails on Windows. They initially try installing Git Bash and changing PATH, but CI still fails. The solution is installing rimraf and cross-env as devDependencies, then changing scripts to 'rimraf dist && mkdir dist' and 'cross-env NODE\_ENV=production build', ensuring POSIX-compatible behavior across all shells.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:22:18.960523+00:00— report_created — created