Windows Rollup Worktree Fix
Symptom
On Windows, a fresh checkout or Git worktree can fail after:
with an error like:
Error: Cannot find module @rollup/rollup-win32-x64-msvc
Root Cause
This is not a Git worktree-specific bug.
The actual issue is that npm may fail to materialize Rollup's Windows native optional package during install:
rollup
@rollup/rollup-win32-x64-msvc
When that package is missing, electron-vite crashes before app startup.
Correct Fix
Declare the Windows Rollup native package explicitly at the workspace root:
"optionalDependencies": {
"@rollup/rollup-win32-x64-msvc": "^4.52.5"
}
Then update the lockfile:
npm install @rollup/rollup-win32-x64-msvc@4.52.5 --save-optional --package-lock-only
Why This Fix
- fixes the problem at install time
- works for normal checkouts and worktrees
- keeps nested worktrees unchanged
- avoids runtime repair scripts and other hotfixes
Verification
From a fresh Windows checkout or worktree:
If the fix is present, node_modules/@rollup/rollup-win32-x64-msvc should exist after install.
Windows Rollup Worktree Fix
Symptom
On Windows, a fresh checkout or Git worktree can fail after:
with an error like:
Root Cause
This is not a Git worktree-specific bug.
The actual issue is that
npmmay fail to materialize Rollup's Windows native optional package during install:rollup@rollup/rollup-win32-x64-msvcWhen that package is missing,
electron-vitecrashes before app startup.Correct Fix
Declare the Windows Rollup native package explicitly at the workspace root:
Then update the lockfile:
Why This Fix
Verification
From a fresh Windows checkout or worktree:
If the fix is present,
node_modules/@rollup/rollup-win32-x64-msvcshould exist after install.