vite-electron-app

raw JSON →
1.4.0 verified Mon Apr 27 auth: no javascript

vite-electron-app is a CLI tool (v1.4.0) for scaffolding Electron + Vite + React + TypeScript desktop applications. It generates a minimalistic, secure-by-default project structure with hot reload, Electron Builder packaging, Vitest testing, and organized separation of concerns. The tool uses npx for instant scaffolding without global install and is idempotent, allowing multiple runs without duplication. Active development with regular releases on npm. Differentiators include native TypeScript, React with Vite, and built-in security against dangerous files.

error Error: Cannot find module '../src/index' from 'vite-electron-app'
cause Running the CLI from a wrong directory or missing dependencies.
fix
Run 'npx vite-electron-app' from a clean project directory after installing dependencies with pnpm.
error zsh: command not found: npx
cause npx is not available in the shell (usually due to missing npm or Node.js).
fix
Install Node.js (version 18+) via https://nodejs.org or nvm.
error Failed to install dependencies: The pnpm command was not found
cause pnpm is not installed.
fix
Install pnpm globally by running 'npm install -g pnpm'.
gotcha Requires Node.js >= 18 and pnpm (not npm) for best results.
fix Use Node.js 18+ and install pnpm via 'npm install -g pnpm'.
deprecated The global install pattern is deprecated; usage via npx is now the primary method.
fix Use npx instead of global install.
breaking In version 1.4.0, the project structure changed: templates now use Electron Builder for packaging instead of electron-forge.
fix If upgrading from older versions, migrate packaging setup to Electron Builder.
gotcha If the target directory already exists, the tool will prompt to overwrite. But if you answer 'yes', the directory contents are replaced.
fix Ensure you have backups or use a fresh directory name.
npm install vite-electron-app
yarn add vite-electron-app
pnpm add vite-electron-app

Scaffold, install dependencies, and start development server for a new Electron + Vite + React app.

npx vite-electron-app my-app
cd my-app
pnpm install
pnpm dev