<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohammed Al-Sarraj</title>
    <description>The latest articles on DEV Community by Mohammed Al-Sarraj (@mohammed-sarraj).</description>
    <link>https://dev.to/mohammed-sarraj</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3797270%2F7392f276-910c-448d-9632-8c2bbc86f064.jpeg</url>
      <title>DEV Community: Mohammed Al-Sarraj</title>
      <link>https://dev.to/mohammed-sarraj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohammed-sarraj"/>
    <language>en</language>
    <item>
      <title>🛠 Fixing Broken Angular Live Reload &amp; EPERM Errors on Windows (For Good)</title>
      <dc:creator>Mohammed Al-Sarraj</dc:creator>
      <pubDate>Sat, 28 Feb 2026 00:24:23 +0000</pubDate>
      <link>https://dev.to/mohammed-sarraj/fixing-broken-angular-live-reload-eperm-errors-on-windows-for-good-335i</link>
      <guid>https://dev.to/mohammed-sarraj/fixing-broken-angular-live-reload-eperm-errors-on-windows-for-good-335i</guid>
      <description>&lt;p&gt;Hello DEV Community 👋&lt;/p&gt;

&lt;p&gt;If you develop Angular applications on Windows, you’ve probably faced at least one of these frustrating issues:&lt;/p&gt;

&lt;p&gt;Live Reload randomly stops working — you save a file, but the browser doesn’t refresh.&lt;/p&gt;

&lt;p&gt;The dreaded EPERM error — the .angular/cache directory gets locked and crashes your build.&lt;/p&gt;

&lt;p&gt;These problems are usually caused by Windows file system behavior and file watcher limitations.&lt;/p&gt;

&lt;p&gt;As a Full-Stack Engineer who values a smooth Developer Experience (DX), I got tired of manually deleting the cache and restarting the server.&lt;/p&gt;

&lt;p&gt;So I built a lightweight automation script to handle it for me.&lt;/p&gt;

&lt;p&gt;💡 The Solution: Angular Auto Runner&lt;/p&gt;

&lt;p&gt;A simple Batch script (Run-Project.bat) that you drop into your project root.&lt;/p&gt;

&lt;p&gt;Double-click it — and your Angular environment is clean, verified, and running safely.&lt;/p&gt;

&lt;p&gt;🔎 What the Script Does&lt;br&gt;
🧹 1. Cleans Angular Cache&lt;/p&gt;

&lt;p&gt;Force-deletes .angular/cache before launch to eliminate common EPERM lock issues.&lt;/p&gt;

&lt;p&gt;📦 2. Verifies Dependencies&lt;/p&gt;

&lt;p&gt;Checks if node_modules exists.&lt;br&gt;
If missing (e.g., fresh clone), it automatically runs npm install.&lt;/p&gt;

&lt;p&gt;⚡ 3. Forces Reliable Live Reload&lt;/p&gt;

&lt;p&gt;Runs:&lt;/p&gt;

&lt;p&gt;ng serve --hmr --poll 2000 --open&lt;/p&gt;

&lt;p&gt;The --poll 2000 flag forces Angular to check file changes every 2 seconds — a reliable workaround for Windows file watcher instability.&lt;/p&gt;

&lt;p&gt;💻 The Script&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/echo"&gt;@echo&lt;/a&gt; off&lt;br&gt;
title Angular Auto Runner - Windows Fix&lt;br&gt;
color 0A&lt;/p&gt;

&lt;p&gt;echo ===================================================&lt;br&gt;
echo      Angular Ultimate Runner (Windows Fix)&lt;br&gt;
echo ===================================================&lt;br&gt;
echo.&lt;/p&gt;

&lt;p&gt;:: 1. Clean Angular Cache&lt;br&gt;
echo [1/3] Cleaning Angular Cache...&lt;br&gt;
if exist ".angular\cache" (&lt;br&gt;
    rmdir /s /q ".angular\cache"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;:: 2. Check Dependencies&lt;br&gt;
echo [2/3] Checking dependencies...&lt;br&gt;
if not exist "node_modules" (&lt;br&gt;
    echo [!] node_modules not found. Installing dependencies...&lt;br&gt;
    call npm install&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;:: 3. Launch Angular with Polling + HMR&lt;br&gt;
echo [3/3] Launching Angular...&lt;br&gt;
echo Mode: HMR + Polling (Windows Safe Mode)&lt;br&gt;
echo ===================================================&lt;br&gt;
call ng serve --hmr --poll 2000 --open&lt;/p&gt;

&lt;p&gt;echo.&lt;br&gt;
echo [!] Server stopped.&lt;br&gt;
pause&lt;br&gt;
📂 Get the Script&lt;/p&gt;

&lt;p&gt;You can grab the file and full documentation from my GitHub repository:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/Mohammed-Sarraj/angular-auto-runner" rel="noopener noreferrer"&gt;Angular Auto Runner&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're developing Angular on Windows, this might save you from a lot of unnecessary restarts and debugging headaches.&lt;/p&gt;

&lt;p&gt;If you use a different approach or have other Windows-specific Angular fixes, I’d love to hear them in the comments.&lt;/p&gt;

&lt;p&gt;Happy coding 🚀&lt;/p&gt;

</description>
      <category>angular</category>
      <category>windows</category>
      <category>automation</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
