Skip to content

Conversation

@CreatorLZ
Copy link

@CreatorLZ CreatorLZ commented Sep 6, 2025

Fix: Add cross-env for universal script execution

Problem:
The current dev and prod scripts, which use the NODE_ENV=... syntax, are not compatible with Windows command prompts (e.g., cmd.exe or PowerShell). This results in the error: 'NODE_ENV' is not recognized as an internal or external command, operable program or batch file.

This prevents Windows-based developers from easily running the project in development or production mode as intended.

Solution:
This PR introduces the cross-env package as a devDependency and updates the dev and prod scripts to use it.

  • "dev": "cross-env NODE_ENV=development node index.js"
  • "prod": "cross-env NODE_ENV=production node index.js"

cross-env is a standard, lightweight solution for setting environment variables in a way that works on all major operating systems, including Windows, Linux, and macOS.

Benefits:

  • Improved accessibility: The project becomes more accessible and easier to contribute to for developers on different platforms.
  • Portability: The package.json scripts are now truly cross-platform, which is a best practice for open-source projects.
  • No breaking changes: This change is fully backward-compatible and has no negative side effects on the project.

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.

1 participant