Skip to content

Windows Compatibility Guide

This Remix Stack has been updated to support Windows development environments. This guide covers the Windows-specific setup and troubleshooting.

Automatic Setup

The stack automatically configures Windows compatibility during installation:

  1. Cross-platform commands: Unix commands like cp, mv, and rm are automatically made available through Windows command shims
  2. ESM module resolution: Node.js options are configured to handle Windows path resolution properly
  3. Build script compatibility: All build and development scripts use cross-platform tools

Requirements

  • Node.js: Version 20 or higher
  • pnpm: Latest version (automatically detected during stack creation)
  • Windows: Windows 11

What Gets Fixed Automatically

1. Unix Command Errors

Problem: Commands like cp "source" "dest" fail with "command not found" Solution: Automatic creation of .cmd shims in node_modules/.bin/ that use shx for cross-platform file operations

2. Path Separator Issues

Problem: Hard-coded Unix path separators cause failures Solution: All scripts use cross-env for environment variable handling

Verification

After installation, you can verify Windows compatibility:

# Run the compatibility test
node scripts/test-windows-compatibility.js

# Check that shims were created (Windows only)
ls node_modules/.bin/*.cmd

Manual Setup (if needed)

If automatic setup fails, you can manually run:

# Install dependencies
pnpm install

# Run Windows setup script manually
node scripts/setup-win-commands.js

Troubleshooting

Issue: "cp is not recognized as an internal or external command"

Cause: Windows setup script didn't run or failed

Solution:

pnpm install  # This should trigger postinstall script
# Or run manually:
node scripts/setup-win-commands.js

Issue: Build scripts fail with path errors

Cause: Path handling differences between Windows and Unix Solution: All scripts now use cross-env for proper cross-platform environment handling

Development Commands

All standard commands work as expected on Windows:

# Development server
pnpm run dev

# Build the application
pnpm run build

# Run tests
pnpm run test

# Generate icons, routes, and API types
pnpm run icons
pnpm run generate-routes
pnpm run generate-api

Technical Details

The Windows compatibility includes:

  1. Command Shims: .cmd files that wrap Unix commands with shx
  2. Cross-platform Environment: cross-env for environment variable handling
  3. Error Handling: Fallbacks for missing dependencies or script failures

If you encounter any Windows-specific issues not covered here, please report them to the team.