Skip to content

fix: use cross-env for Windows-compatible environment variable in npm script#4809

Open
algojogacor wants to merge 1 commit into
slab:mainfrom
algojogacor:fix/windows-env-var-cross-platform
Open

fix: use cross-env for Windows-compatible environment variable in npm script#4809
algojogacor wants to merge 1 commit into
slab:mainfrom
algojogacor:fix/windows-env-var-cross-platform

Conversation

@algojogacor

Copy link
Copy Markdown

This is an independent contribution. I am not affiliated with the project maintainers.

Summary

Fix npm start failing on Windows due to Unix-only environment variable syntax in the start:website script. The inline NEXT_PUBLIC_LOCAL_QUILL=true syntax is not recognized by Windows Command Prompt or PowerShell.

Root Cause

In package.json, the start:website script uses Unix-style inline environment variable assignment:

NEXT_PUBLIC_LOCAL_QUILL=true npm start -w website

Windows shells (cmd.exe, PowerShell) do not support VAR=value command syntax, causing error: 'NEXT_PUBLIC_LOCAL_QUILL' is not recognized as an internal or external command.

Fix

Replaced the inline environment variable with cross-env to ensure cross-platform compatibility:

cross-env NEXT_PUBLIC_LOCAL_QUILL=true npm start -w website

Added cross-env as a devDependency (^7.0.3).

Testing

  • The change only affects the npm script declaration, not production code
  • cross-env has 7M+ weekly downloads and is the standard solution for cross-platform environment variables in npm scripts
  • Existing Unix/macOS behavior is preserved

Closes #3916

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.

Error when setting up project locally - 'USE_LOCAL_FILE' is not recognized as an internal or external command, operable program or batch file

1 participant