Skip to content

Windows compatibility: Unix commands prevent yarn install and yarn dx #25376

@tanujbhaud

Description

@tanujbhaud

Windows compatibility: Unix commands (rm, cp) prevent yarn install and yarn dx from working

Description

Windows developers cannot successfully run yarn install or yarn dx due to Unix-specific shell commands (rm, cp, cd) in multiple package.json scripts. Issue #14445 previously addressed this in @calcom/embed-core, but the same problem exists in 8+ other packages, still blocking Windows development.

Environment

  • OS: Windows 10/11
  • Shell: PowerShell, CMD, Git Bash
  • Node.js: v20.x
  • Yarn: 3.4.1

Steps to Reproduce

  1. Clone the repository on Windows
  2. Run yarn install
  3. Observe error: 'rm' is not recognized as an internal or external command
@calcom/platform-enums:post-install: 'rm' is not recognized as an internal or external command,
@calcom/platform-enums:post-install: operable program or batch file.
@calcom/platform-enums:post-install: command not found: rm
@calcom/platform-enums:post-install: ERROR: command finished with error
  1. Alternatively, after manually fixing and running yarn dx:
@calcom/prisma:db-up: unknown shorthand flag: 'd' in -d
@calcom/prisma:db-up: command not found: rm

Affected Packages

The following packages contain Unix-only commands that fail on Windows:

Build Scripts (block yarn install):

  • @calcom/platform-enums - rm -rf ./dist
  • @calcom/platform-types - rm -rf ./dist
  • @calcom/embed-core - rm -rf dist, cp -r
  • @calcom/embed-react - rm -rf dist, cp
  • @calcom/embed-snippet - rm -rf dist

Clean Scripts (manually invoked):

  • @calcom/web - rm -rf .turbo && rm -rf node_modules
  • @calcom/api (v1) - rm -rf .turbo && rm -rf node_modules
  • @calcom/prisma - rm -rf .turbo && rm -rf node_modules, cd ../.. in db-up

Additional Issues:

  • packages/prisma/.env contains ../../.env which Docker Compose cannot parse on Windows
  • docker-compose.yml missing database port mapping (DATABASE_URL expects port 5450)

Expected Behavior

  • yarn install should complete successfully on Windows
  • yarn dx should start development environment on Windows
  • All build scripts should work cross-platform

Proposed Solution

Replace Unix-specific commands with cross-platform alternatives:

Option 1: Use Node.js fs module (zero dependencies)

"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && vite build"
"clean": "node -e \"require('fs').rmSync('.turbo',{recursive:true,force:true})\""

Option 2: Use rimraf package (as suggested in #14445)

"build": "rimraf dist && vite build"

Related Issues

Impact

  • Severity: High - Blocks Windows developers from contributing
  • Scope: Affects initial setup (yarn install) and development (yarn dx)
  • Workaround: Use WSL or Git Bash (not ideal, adds friction)

Additional Context

Windows has significant market share among developers, and cross-platform compatibility is essential for an open-source project. The fix is straightforward and has zero impact on Unix/macOS users.


I have a PR ready with all fixes tested on Windows 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions