<?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: Kausar Raza</title>
    <description>The latest articles on DEV Community by Kausar Raza (@kausarraza).</description>
    <link>https://dev.to/kausarraza</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4182821%2Fab780158-8181-49a2-8444-8faa64cc463f.webp</url>
      <title>DEV Community: Kausar Raza</title>
      <link>https://dev.to/kausarraza</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kausarraza"/>
    <language>en</language>
    <item>
      <title>'Another next dev server is already running': How to Fix It (Next.js 16)</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Wed, 25 Nov 2026 06:46:03 +0000</pubDate>
      <link>https://dev.to/kausarraza/another-next-dev-server-is-already-running-how-to-fix-it-nextjs-16-50i1</link>
      <guid>https://dev.to/kausarraza/another-next-dev-server-is-already-running-how-to-fix-it-nextjs-16-50i1</guid>
      <description>&lt;p&gt;I ran &lt;code&gt;npm run dev&lt;/code&gt; on a Next.js 16 project and got this instead of a working server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; next dev

⚠ Port 3000 is in use by process 968, using available port 3001 instead.
▲ Next.js 16.3.3 (Turbopack)
- Local:         http://localhost:3001
- Network:       http://192.168.1.20:3001
✓ Ready in 1414ms
⨯ Another next dev server is already running.

- Local:        http://localhost:3000
- PID:          968
- Dir:          C:\projects\my-app
- Log:          .next\dev\logs\next-development.log

You can access the existing server at http://localhost:3000,
or run taskkill /PID 968 /F to stop it and start a new one.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The message is honest and the fix it suggests is right: an older &lt;code&gt;next dev&lt;/code&gt; is still running for the same project, and you either use it or stop it. But on Windows the suggested command can fail, the old server is often one you can't see, and the tempting shortcut (deleting the lock file) makes things worse. Here's what the error actually checks and the fix that worked for me on Windows 11 with Next.js 16.3.3.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "Another next dev server is already running" means
&lt;/h2&gt;

&lt;p&gt;Next.js 16 keeps a lock file for the dev server at &lt;code&gt;.next/dev/lock&lt;/code&gt;. When &lt;code&gt;next dev&lt;/code&gt; starts, it tries to take that lock. If another process holds it, Next retries for about one second, prints the error and exits with code 1. The lock is not just an empty marker. While my server was running, the file contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"pid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;84408&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"hostname"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"localhost"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"appUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"http://localhost:3000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"startedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1795587750098&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's where the PID, the URL and the "Dir" line in the error come from. So the message doesn't guess. A process with that PID took the lock for this project folder and hasn't let go of it.&lt;/p&gt;

&lt;p&gt;Two details worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The check is per project folder, not per port.&lt;/strong&gt; Two different projects can run &lt;code&gt;next dev&lt;/code&gt; side by side. Two servers in the same folder can't, because they would write into the same &lt;code&gt;.next/dev&lt;/code&gt; directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The port warning comes first.&lt;/strong&gt; In my run, Next saw port 3000 busy, said it would use 3001, even printed "Ready", and only then hit the lock and quit. If you only read the top of the output, it looks like the server started on 3001. It didn't.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why the old server is still running
&lt;/h2&gt;

&lt;p&gt;In my case nothing was visible. No terminal showed a server, yet PID 968 held port 3000. The cause was an orphan: the &lt;code&gt;npm run dev&lt;/code&gt; wrapper had been stopped, but the Node process it started (Next's &lt;code&gt;start-server.js&lt;/code&gt;) kept running. That's the most common way to end up here. Other ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You started &lt;code&gt;npm run dev&lt;/code&gt; in another terminal tab, VS Code's integrated terminal or a VS Code task, and forgot about it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A terminal window was closed or crashed, but the Node process survived.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A tool or script started the dev server in the background (a test runner, a "run" button, an AI coding agent).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The easy first step: open the URL from the error (&lt;code&gt;http://localhost:3000&lt;/code&gt;). If your app loads, that old server is working fine and you can simply keep using it. You only need a new one if you changed environment variables, &lt;code&gt;next.config&lt;/code&gt; or something else that's read at startup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix: check the PID, then stop it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Make sure the PID is really your Next.js server
&lt;/h3&gt;

&lt;p&gt;Before you force-kill anything, check what the PID is. On Windows, PowerShell shows the full command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c1"&gt;# PowerShell: what is PID 968, really?&lt;/span&gt;
&lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;CimInstance&lt;/span&gt; &lt;span class="nc"&gt;Win32_Process&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;Filter&lt;/span&gt; &lt;span class="s2"&gt;"ProcessId=968"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Select&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExpandProperty&lt;/span&gt; &lt;span class="nc"&gt;CommandLine&lt;/span&gt;

&lt;span class="c1"&gt;# Output on my machine:&lt;/span&gt;
&lt;span class="s2"&gt;"C:\Program Files\nodejs\node.exe"&lt;/span&gt; &lt;span class="no"&gt;C&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;\&lt;span class="n"&gt;projects&lt;/span&gt;\&lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;\&lt;span class="n"&gt;node_modules&lt;/span&gt;\&lt;span class="n"&gt;next&lt;/span&gt;\&lt;span class="n"&gt;dist&lt;/span&gt;\&lt;span class="n"&gt;server&lt;/span&gt;\&lt;span class="n"&gt;lib&lt;/span&gt;\&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it's &lt;code&gt;node.exe&lt;/code&gt; running &lt;code&gt;next\dist\server\lib\start-server.js&lt;/code&gt; inside your project folder, it's the stale dev server and safe to stop. If it's something else, don't force-kill it. Find out what it is first.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Stop it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;::&lt;/span&gt; &lt;span class="nc"&gt;Command&lt;/span&gt; &lt;span class="nc"&gt;Prompt&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nc"&gt;PowerShell&lt;/span&gt;
&lt;span class="n"&gt;taskkill&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;PID&lt;/span&gt; &lt;span class="mi"&gt;968&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;F&lt;/span&gt;

&lt;span class="c1"&gt;# PowerShell only&lt;/span&gt;
&lt;span class="nc"&gt;Stop&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;Process&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Id&lt;/span&gt; &lt;span class="mi"&gt;968&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run &lt;code&gt;npm run dev&lt;/code&gt; again. Once the old process is gone, the operating system releases the lock and the new server starts normally on port 3000.&lt;/p&gt;

&lt;h3&gt;
  
  
  In Git Bash, the printed command fails
&lt;/h3&gt;

&lt;p&gt;Next.js prints &lt;code&gt;taskkill /PID 968 /F&lt;/code&gt; on Windows. Paste that into Git Bash and you get a confusing error, because Git Bash converts any argument that starts with a slash into a Windows path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Git Bash: the command Next.js prints fails&lt;/span&gt;
$ taskkill /PID 968 /F
ERROR: Invalid argument/option - &lt;span class="s1"&gt;'C:/Program Files/Git/PID'&lt;/span&gt;.

&lt;span class="c"&gt;# Any of these work&lt;/span&gt;
$ taskkill //PID 968 //F
$ taskkill -PID 968 -F
$ &lt;span class="nv"&gt;MSYS_NO_PATHCONV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 taskkill /PID 968 /F
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I tested all three working forms. The full explanation of that path conversion, plus &lt;code&gt;netstat&lt;/code&gt; and PowerShell ways of finding who holds a port, is in my post on &lt;a href="https://knowledgemarkg.com/blog/eaddrinuse-address-already-in-use-3000-windows" rel="noopener noreferrer"&gt;EADDRINUSE: address already in use :::3000 on Windows&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  On macOS and Linux
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS / Linux (the command Next.js prints there)&lt;/span&gt;
&lt;span class="nb"&gt;kill&lt;/span&gt; 968
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the command Next.js prints outside Windows. I've only tested the Windows side myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't delete .next/dev/lock
&lt;/h2&gt;

&lt;p&gt;The lock is a file, so deleting it looks like the quick fix. I tried it to see what happens. While my server was still running, &lt;code&gt;rm .next/dev/lock&lt;/code&gt; worked without any error on Windows. The next &lt;code&gt;npm run dev&lt;/code&gt; then moved to port 3001, printed "Ready" and kept running. Now I had &lt;strong&gt;two&lt;/strong&gt; dev servers for one project, both using the same &lt;code&gt;.next/dev&lt;/code&gt; folder. That's the exact situation the lock exists to prevent. I stopped the test there, but I wouldn't trust compiled output written by two servers at once.&lt;/p&gt;

&lt;p&gt;Deleting the whole &lt;code&gt;.next&lt;/code&gt; folder doesn't fix the real problem either. The old process keeps running and keeps port 3000. Stop the process. The lock goes away with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Port in use vs server already running: which error do you get?
&lt;/h2&gt;

&lt;p&gt;Same cause, different messages, depending on how you start the server:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You run&lt;/th&gt;
&lt;th&gt;Old server holds the lock&lt;/th&gt;
&lt;th&gt;What you see&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;next dev&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Port warning, then "Another next dev server is already running"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;next dev -p 3000&lt;/td&gt;
&lt;td&gt;yes or no&lt;/td&gt;
&lt;td&gt;"Failed to start server", listen EADDRINUSE: address already in use :::3000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;next dev&lt;/td&gt;
&lt;td&gt;no (lock deleted)&lt;/td&gt;
&lt;td&gt;Port warning, server starts on 3001 (two servers)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With a fixed port the port check fails first, so you get EADDRINUSE and never reach the lock check. Either way, the fix is the same: find the PID and stop it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;:: Windows: who is listening on 3000?
netstat -ano &lt;span class="o"&gt;|&lt;/span&gt; findstr :3000
  TCP    0.0.0.0:3000    0.0.0.0:0    LISTENING    968
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What about next build?
&lt;/h2&gt;

&lt;p&gt;Builds have their own lock. In Next.js 16.3.3's source, &lt;code&gt;next build&lt;/code&gt; locks &lt;code&gt;.next/lock&lt;/code&gt; and, if it's held, prints "Another next build process is already running", suggesting a build still in progress or one that didn't exit cleanly. I haven't hit that one myself. The dev lock lives in &lt;code&gt;.next/dev&lt;/code&gt;, a separate folder.&lt;/p&gt;

&lt;p&gt;One more trap from my own deploys: a &lt;code&gt;next start&lt;/code&gt; left running while you build can write the old build's pages into the new &lt;code&gt;.next&lt;/code&gt; folder. It's a different symptom (pages pointing at missing chunk files, the same thing behind a &lt;a href="https://knowledgemarkg.com/blog/chunkloaderror-nextjs-after-deploy-cdn-cached-html" rel="noopener noreferrer"&gt;ChunkLoadError after a deploy&lt;/a&gt;), but the cause is the same: a forgotten server process. Before a production build, check that nothing is listening on your ports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Read the whole error. The PID and URL are in it, and the "using port 3001" line above it is misleading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the URL. If the app works, you may not need a new server at all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the PID's command line, then stop it: &lt;code&gt;taskkill /PID &amp;lt;pid&amp;gt; /F&lt;/code&gt;, &lt;code&gt;Stop-Process -Id &amp;lt;pid&amp;gt; -Force&lt;/code&gt;, or &lt;code&gt;taskkill //PID &amp;lt;pid&amp;gt; //F&lt;/code&gt; in Git Bash.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Don't delete &lt;code&gt;.next/dev/lock&lt;/code&gt; while the old process lives. You'll get two servers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Closing a terminal or stopping &lt;code&gt;npm&lt;/code&gt; doesn't always stop the Node child. Check the port afterwards.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/another-next-dev-server-is-already-running" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>windows</category>
      <category>javascript</category>
    </item>
    <item>
      <title>"The Email Account That You Tried to Reach Does Not Exist" (550 5.1.1): What It Means</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Tue, 24 Nov 2026 06:30:40 +0000</pubDate>
      <link>https://dev.to/kausarraza/the-email-account-that-you-tried-to-reach-does-not-exist-550-511-what-it-means-102h</link>
      <guid>https://dev.to/kausarraza/the-email-account-that-you-tried-to-reach-does-not-exist-550-511-what-it-means-102h</guid>
      <description>&lt;p&gt;Yesterday I emailed a publication about writing for them, using the address on their own "write for us" page. The reply arrived in under a second, and it wasn't from them (I've replaced their domain):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Address not found

Your message wasn't delivered to content@their-domain.com because the address
couldn't be found, or is unable to receive mail.

The response was:

The email account that you tried to reach does not exist. Please try
double-checking the recipient's email address for typos or unnecessary spaces.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've had the same message, here's what it means: &lt;strong&gt;the domain accepted the connection, but the mailbox you wrote to doesn't exist there.&lt;/strong&gt; Your email was not delivered, not filtered as spam and not queued for later. Nobody read it. The fix is either a corrected address or a different way to reach the person.&lt;/p&gt;

&lt;p&gt;Below is how I worked out which of those it was in about two minutes, what the codes mean (&lt;code&gt;550 5.1.1&lt;/code&gt;, and the ones that look similar but aren't), and what it means when you get this bounce for an email you never sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "the email account that you tried to reach does not exist" means
&lt;/h2&gt;

&lt;p&gt;When you send an email, your provider looks up the recipient domain's mail servers and asks them to accept a message for one address. The receiving server can say yes, or refuse that one address. This bounce is the refusal: the server is reachable and answering for the domain, and it is saying "I have no mailbox by that name."&lt;/p&gt;

&lt;p&gt;That rules out a lot of things people worry about. It isn't a block on your account, a spam judgement, or a sign your own email is broken. Your provider delivered the message to the right servers. The address on the envelope is the problem.&lt;/p&gt;

&lt;p&gt;The wording is Google's. You see it when the &lt;em&gt;receiving&lt;/em&gt; side is Gmail or Google Workspace, whatever you sent from. Other providers phrase the same refusal differently ("User unknown", "Recipient address rejected", "mailbox unavailable"), usually next to the same &lt;code&gt;5.1.1&lt;/code&gt; code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where is the "550 5.1.1"? Mine had no code at all
&lt;/h2&gt;

&lt;p&gt;Most articles tell you to look for &lt;code&gt;550 5.1.1&lt;/code&gt; in the bounce. Mine didn't have it. I opened the bounce with &lt;strong&gt;Show original&lt;/strong&gt; in Gmail to check: no &lt;code&gt;550&lt;/code&gt;, no &lt;code&gt;Status:&lt;/code&gt;, no &lt;code&gt;Diagnostic-Code:&lt;/code&gt; line anywhere. Just the sentence above and a help link.&lt;/p&gt;

&lt;p&gt;An older bounce in the same inbox, from August 2025, does show the full code. It came from an app sending a verification email to a Gmail address that didn't exist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The response was:

550 5.1.1 The email account that you tried to reach does not exist. Please try
double-checking the recipient's email address for typos or unnecessary spaces.
For more information, go to https://support.google.com/mail/?p=NoSuchUser ... - gsmtp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its summary fields read &lt;code&gt;Status: 5.1.1&lt;/code&gt; and &lt;code&gt;Diagnostic-Code: smtp; 550-5.1.1&lt;/code&gt;. Same sentence, same meaning. The only difference is how much of the server conversation Gmail chose to show. So if your bounce has the sentence but no number, it's the same &lt;code&gt;5.1.1&lt;/code&gt; error. Don't go looking for a different cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  What 550 5.1.1 means, and the codes that look like it
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;550&lt;/code&gt; is the SMTP reply ("requested action not taken: mailbox unavailable"). The three-part number after it is the enhanced status code. The first digit, 5, means permanent: retrying the same address won't help. The ones you're likely to see:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning (RFC)&lt;/th&gt;
&lt;th&gt;What it usually tells you&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;5.1.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bad destination mailbox address&lt;/td&gt;
&lt;td&gt;Domain is fine, that mailbox doesn't exist: typo, old address, deleted account&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;5.1.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bad destination system address&lt;/td&gt;
&lt;td&gt;The domain part is wrong or doesn't receive mail at all&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;5.1.3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bad destination mailbox address syntax&lt;/td&gt;
&lt;td&gt;The address isn't valid as typed (a space, two @ signs, a stray character)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;5.1.10&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Recipient address has null MX&lt;/td&gt;
&lt;td&gt;The domain has published that it accepts no email at all&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;5.2.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mailbox disabled, not accepting messages&lt;/td&gt;
&lt;td&gt;The account exists but is switched off or suspended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;5.2.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mailbox full&lt;/td&gt;
&lt;td&gt;The account exists; the owner needs to clear space&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Meanings are from RFC 3463 (and RFC 7505 for &lt;code&gt;5.1.10&lt;/code&gt;). Servers sometimes misuse them, so treat the code as a strong hint and the text next to it as the detail. "550 5.1.1 recipient rejected", "user unknown" and "recipient address rejected" are the same refusal in different servers' words.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: rule out your own typo
&lt;/h2&gt;

&lt;p&gt;Most of these bounces are a mistyped address, so check that first. Open the bounce and copy the address it quotes (it shows what was actually sent, which isn't always what you think you typed). Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autocomplete picking an old address.&lt;/strong&gt; Your mail app suggests addresses you've used before, including ones that no longer exist.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A wrong ending&lt;/strong&gt;: &lt;code&gt;.co&lt;/code&gt; for &lt;code&gt;.com&lt;/code&gt;, &lt;code&gt;.com&lt;/code&gt; for &lt;code&gt;.co.uk&lt;/code&gt;, or the company's website domain when their mail is on a different one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swapped or doubled letters&lt;/strong&gt; in the name part, and hyphens or dots in the wrong place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spaces&lt;/strong&gt;, especially a trailing space after pasting. Google's message mentions "unnecessary spaces" for a reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing that is &lt;em&gt;not&lt;/em&gt; a typo: dots in a personal &lt;code&gt;@gmail.com&lt;/code&gt; address. Gmail ignores them, so &lt;code&gt;jane.doe@gmail.com&lt;/code&gt; and &lt;code&gt;janedoe@gmail.com&lt;/code&gt; reach the same inbox. That rule doesn't apply to company addresses on Google Workspace or anywhere else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: check the domain actually receives email
&lt;/h2&gt;

&lt;p&gt;If the address looks right, check the domain has mail servers. This takes one command, and it tells you whether you're dealing with a dead mailbox (&lt;code&gt;5.1.1&lt;/code&gt;) or a dead domain. On Windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nslookup -type=mx their-domain.com

their-domain.com  MX preference = 1, mail exchanger = aspmx.l.google.com
their-domain.com  MX preference = 1, mail exchanger = alt1.aspmx.l.google.com
their-domain.com  MX preference = 1, mail exchanger = alt2.aspmx.l.google.com
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS or Linux, &lt;code&gt;dig +short MX example.com&lt;/code&gt; gives the same list. Any online "MX lookup" tool works too.&lt;/p&gt;

&lt;p&gt;For me the answer settled it. The publication's domain uses Google Workspace (&lt;code&gt;aspmx.l.google.com&lt;/code&gt; and its four backups), so their domain receives mail without any problem. The &lt;code&gt;content@&lt;/code&gt; mailbox is what's gone. If the lookup had returned nothing, the address would be wrong at the domain level and I'd be looking at a &lt;code&gt;5.1.2&lt;/code&gt;-type problem instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: the address is right, but nobody's there
&lt;/h2&gt;

&lt;p&gt;This was my case, and it's common with role addresses like &lt;code&gt;content@&lt;/code&gt;, &lt;code&gt;jobs@&lt;/code&gt; or &lt;code&gt;press@&lt;/code&gt;. Someone set up a mailbox or alias years ago, put it on a page, then deleted it or moved to a form, and the page never got updated. I checked the page again the next day: it still links that address.&lt;/p&gt;

&lt;p&gt;No amount of resending fixes this. What does:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Find another route on the same site.&lt;/strong&gt; A contact form, a different address on the contact or about page, or the footer. I resent my application through their contact form, with a line saying the address on their write-for-us page bounces. That way they also learn about the broken address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write to a person, not a role.&lt;/strong&gt; If you know who runs the team, LinkedIn or a personal address listed publicly often works when a role mailbox doesn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't guess variations.&lt;/strong&gt; Sending to five made-up addresses (&lt;code&gt;editor@&lt;/code&gt;, &lt;code&gt;info@&lt;/code&gt;, &lt;code&gt;hello@&lt;/code&gt;...) produces more hard bounces. A burst of bounces from one account is the kind of pattern mail providers notice.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If it's someone you know personally, they may have left the company or closed the account. Ask them for a current address another way.&lt;/p&gt;

&lt;h2&gt;
  
  
  "I got this bounce for an email I never sent"
&lt;/h2&gt;

&lt;p&gt;This is the second big search behind this error ("does not exist spam"), and it's a different situation. First open your &lt;strong&gt;Sent&lt;/strong&gt; folder and look for the message the bounce refers to.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's in Sent and you didn't write it:&lt;/strong&gt; someone may be using your account. Change the password, turn on 2-step verification, and review the account's recent security activity and connected apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It isn't in Sent:&lt;/strong&gt; most likely a spammer put your address in the &lt;em&gt;From&lt;/em&gt; line of their own mail. When their message hit a dead mailbox, the bounce came back to the address they forged: you. This is called backscatter. Your account isn't compromised, and you can delete these.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you own the domain you send from, publish SPF, DKIM and a DMARC record. Receiving servers can then reject forged mail claiming to be from you before it bounces anywhere. If you use Cloudflare Email Routing to receive mail on your own domain, the setup I use, including the SPF record, is in &lt;a href="https://knowledgemarkg.com/blog/cloudflare-email-routing-gmail-setup-not-working" rel="noopener noreferrer"&gt;Cloudflare Email Routing to Gmail: what breaks it&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  If people get this error when they email you
&lt;/h2&gt;

&lt;p&gt;When clients or colleagues say their mail to you bounced with "does not exist", the problem is on your side:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Workspace or Microsoft 365:&lt;/strong&gt; check the user still exists, isn't suspended, and that the address they used is a real alias of that user. When a former employee's account is deleted, their address stops working unless it's added as an alias to another user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forwarding services:&lt;/strong&gt; make sure there's a rule for that exact address, or a catch-all. An address with no rule has nowhere to go.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your website:&lt;/strong&gt; search the site for every address it shows, including old blog posts and PDFs. My example came from a public page still showing an address that no longer existed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To test, send a message to the address from an outside account (not from the same mailbox) and see whether it arrives or bounces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;"The email account that you tried to reach does not exist" = &lt;code&gt;550 5.1.1&lt;/code&gt;: the domain is fine, the mailbox isn't. The message wasn't delivered.&lt;/li&gt;
&lt;li&gt;Gmail sometimes hides the code. Same sentence, same error.&lt;/li&gt;
&lt;li&gt;Check the address in the bounce for typos, then run an MX lookup on the domain.&lt;/li&gt;
&lt;li&gt;MX records present and address correct: the mailbox is gone. Find another route, don't keep resending.&lt;/li&gt;
&lt;li&gt;Bounce for mail you never sent: check Sent. Not there = backscatter. There = secure the account.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does "The email account that you tried to reach does not exist" mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The recipient's mail server (Gmail or Google Workspace) is working, but it has no mailbox with that address. Your email was not delivered and nobody received it. Check the address for a typo; if it's correct, the account was deleted or never existed, and you need another way to reach the person.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is error 550 5.1.1?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;550 is the SMTP 'mailbox unavailable' reply and 5.1.1 is the enhanced code for 'bad destination mailbox address'. It's a permanent failure: the domain accepts mail but that specific address doesn't exist. Resending to the same address will bounce again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Was my email delivered if I got this bounce?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. The receiving server refused the message for that address, so it wasn't delivered, filtered to spam or queued. The bounce is the only copy that went anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does my Gmail bounce not show the 550 5.1.1 code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gmail doesn't always include the server reply in the notice. A bounce I got in November 2026 had only the sentence, with no 550 or Status line even in Show original, while an older one showed '550 5.1.1 ... - gsmtp'. The sentence alone means the same error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I check whether an email address exists?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can confirm the domain receives mail with an MX lookup (nslookup -type=mx domain.com or dig MX domain.com). There's no reliable public way to confirm a single mailbox exists, because many servers don't reveal it. The practical test is a correct address on the person's current website, or asking them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why am I getting "address not found" bounces for emails I didn't send?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Look in your Sent folder. If the message isn't there, a spammer most likely forged your address as the sender and the bounce came back to you (backscatter); you can delete it. If it is there and you didn't write it, secure your account: new password, 2-step verification, check connected apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I fix 550 5.1.1 when people email my domain?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure the address exists: an active user or alias in Google Workspace or Microsoft 365, or a routing rule or catch-all in your forwarding service. Then test from an outside account. Also remove old addresses from your website so people stop using them.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/email-account-you-tried-to-reach-does-not-exist-550-5-1-1" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>email</category>
      <category>gmail</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Mega Menu SEO: Your Dropdown Links May Not Be in the HTML</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Tue, 24 Nov 2026 05:09:12 +0000</pubDate>
      <link>https://dev.to/kausarraza/mega-menu-seo-your-dropdown-links-may-not-be-in-the-html-55p</link>
      <guid>https://dev.to/kausarraza/mega-menu-seo-your-dropdown-links-may-not-be-in-the-html-55p</guid>
      <description>&lt;p&gt;A mega menu can look perfect, open on hover, pass every accessibility check, and still give Google &lt;strong&gt;zero links&lt;/strong&gt;. If the dropdown is built in React and only renders its panel when it opens, the links aren't in the HTML your server sends, and Googlebot never opens the menu to make them appear. I found this on my own site this week: the header listed nine service pages, and the live home page linked none of them from the header.&lt;/p&gt;

&lt;p&gt;This post covers how to check your own menu in 30 seconds, which popular React menu components behave this way (I tested Radix, shadcn/ui's base and Headless UI), and the fix I shipped, with its real cost in DOM size.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Does Google crawl mega menu links?&lt;/strong&gt; Only if they're real &lt;code&gt;&amp;lt;a href&amp;gt;&lt;/code&gt; links in the page's HTML. Google renders JavaScript, but it doesn't hover or click, so a panel that renders only on hover or click never appears for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Which menus are affected?&lt;/strong&gt; In my test, the closed state of Radix NavigationMenu, Radix DropdownMenu, Headless UI Menu, Popover and Disclosure, and any &lt;code&gt;{open &amp;amp;&amp;amp; &amp;lt;ul&amp;gt;}&lt;/code&gt; pattern, all rendered &lt;strong&gt;0 of 2&lt;/strong&gt; links.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The fix:&lt;/strong&gt; keep the links in the HTML while the menu is closed. Use &lt;code&gt;forceMount&lt;/code&gt; (Radix), &lt;code&gt;unmount={false}&lt;/code&gt; (Headless UI), a CSS-hidden panel, or a hidden list of plain links.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I found on my own site
&lt;/h2&gt;

&lt;p&gt;knowledgemarkg.com runs on Next.js. In November I replaced the header with a mega menu: Services, Free Tools and Blog, each with a two-column dropdown. The label is a link to the section page, and a chevron button opens the panel. It works well for people.&lt;/p&gt;

&lt;p&gt;While checking why a few service pages were slow to get indexed, I fetched the live home page with &lt;code&gt;curl&lt;/code&gt; and counted the links to &lt;code&gt;/services/&lt;/code&gt;. There were &lt;strong&gt;4&lt;/strong&gt;, all from the footer and the page body. The header's dropdown links to the nine service pages weren't in the HTML at all, because the component rendered the panel like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The pattern most hand-rolled menus use&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;MegaMenu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;menu&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;onMouseEnter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;onMouseLeave&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Link&lt;/span&gt; &lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Link&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="n"&gt;aria&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;expanded&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;▾&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Panel&lt;/span&gt; &lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;   &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* closed = nothing in the HTML */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the panel is closed, React renders &lt;code&gt;null&lt;/code&gt;. That's the state the server renders, so that's the HTML Google gets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check your own menu in 30 seconds
&lt;/h2&gt;

&lt;p&gt;Don't use the browser's Elements panel for this. By the time you look, you've probably hovered the menu, and DevTools shows the live DOM, not what the server sent. Use &lt;strong&gt;View Source&lt;/strong&gt; (Ctrl+U), or &lt;code&gt;curl&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# What the server actually sends (no JavaScript run, no clicks)&lt;/span&gt;
curl -s -A &lt;span class="s2"&gt;"Mozilla/5.0"&lt;/span&gt; https://example.com/ &lt;span class="o"&gt;|&lt;/span&gt; grep -o &lt;span class="s1"&gt;'href="/services/[^"]*"'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort -u

&lt;span class="c"&gt;# Count them&lt;/span&gt;
curl -s -A &lt;span class="s2"&gt;"Mozilla/5.0"&lt;/span&gt; https://example.com/ &lt;span class="o"&gt;|&lt;/span&gt; grep -o &lt;span class="s1"&gt;'href="/services/[^"]*"'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort -u &lt;span class="o"&gt;|&lt;/span&gt; wc -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap &lt;code&gt;/services/&lt;/code&gt; for any path your menu links to. If a page in your dropdown doesn't show up, it isn't in the server HTML. Two more checks are useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Search Console → URL Inspection → View crawled page → HTML.&lt;/strong&gt; That's the HTML after Google rendered it. If the links aren't there either, Google didn't see them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare with the sitemap.&lt;/strong&gt; A page that is in your sitemap but linked from nowhere visible to a crawler often ends up in "Discovered - currently not indexed". I wrote about the difference in &lt;a href="https://knowledgemarkg.com/blog/crawled-vs-discovered-currently-not-indexed" rel="noopener noreferrer"&gt;Crawled vs Discovered - currently not indexed&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Google doesn't see links in a closed menu
&lt;/h2&gt;

&lt;p&gt;Two parts of Google's documentation explain it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google's crawlable-links guide says it can generally crawl a link only if it's an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element with an &lt;code&gt;href&lt;/code&gt;. Links inserted with JavaScript count too, as long as they end up as that same markup.&lt;/li&gt;
&lt;li&gt;Its lazy-loading guide says plainly that Google Search does not interact with your page: no scrolling, no clicking. Hover is not mentioned at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So rendering isn't the issue. Google does run your JavaScript. The issue is that nothing ever sets &lt;code&gt;open&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; during rendering. Content that waits for a user action never exists for the crawler.&lt;/p&gt;

&lt;p&gt;This is different from content that's on the page but hidden with CSS, like a collapsed accordion. Those links &lt;em&gt;are&lt;/em&gt; in the HTML. The question for an accordion is how much weight hidden text gets. For a conditionally rendered menu, there's nothing there to weigh.&lt;/p&gt;

&lt;h2&gt;
  
  
  I tested the popular React menu components
&lt;/h2&gt;

&lt;p&gt;To see whether this is just my hand-rolled menu, I rendered each component on the server with React's &lt;code&gt;renderToString&lt;/code&gt;, closed, with the same two &lt;code&gt;&amp;lt;a href="/services/..."&amp;gt;&lt;/code&gt; links inside, and counted the links in the output. Versions: React 19.3.1, @radix-ui/react-navigation-menu 1.4.1, @radix-ui/react-dropdown-menu 2.2.1, @headlessui/react 2.2.10.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component (closed)&lt;/th&gt;
&lt;th&gt;Links in server HTML&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Radix NavigationMenu&lt;/td&gt;
&lt;td&gt;0 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Radix NavigationMenu, &lt;code&gt;Content forceMount&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;2 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Radix DropdownMenu&lt;/td&gt;
&lt;td&gt;0 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Headless UI Menu&lt;/td&gt;
&lt;td&gt;0 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Headless UI Popover&lt;/td&gt;
&lt;td&gt;0 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Headless UI Popover, &lt;code&gt;unmount={false}&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;2 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Headless UI Disclosure&lt;/td&gt;
&lt;td&gt;0 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hand-rolled &lt;code&gt;{open &amp;amp;&amp;amp; &amp;lt;ul&amp;gt;}&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;0 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Native &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;2 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Panel always rendered, hidden with CSS&lt;/td&gt;
&lt;td&gt;2 of 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The test was just this, once per component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;renderToString&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"react-dom/server"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ...build each menu closed, with two &amp;lt;a href="/services/..."&amp;gt; inside...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;renderToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"\/services/g) || []).length, "&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="s2"&gt;");
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;shadcn/ui's Navigation Menu and Dropdown Menu are built on these Radix components, so I'd expect the same result, but I tested the Radix packages, not the shadcn copies. Server-rendering the closed state like this is a fair stand-in for the first HTML a crawler gets, but it isn't Googlebot itself. Use the URL Inspection check above to confirm what Google saw on your site.&lt;/p&gt;

&lt;p&gt;None of this is a bug in those libraries. Unmounting closed popups is a sensible default for dropdowns full of actions like "Delete" or "Sign out". It just isn't what you want for site navigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four ways to fix it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Keep the panel mounted (library option)
&lt;/h3&gt;

&lt;p&gt;If you use a library, it probably already has a switch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Radix NavigationMenu (and shadcn/ui's NavigationMenu, which wraps it)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NavigationMenu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Content&lt;/span&gt; &lt;span class="n"&gt;forceMount&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;links&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;NavigationMenu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="c1"&gt;// Headless UI v2&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;PopoverPanel&lt;/span&gt; &lt;span class="n"&gt;unmount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;links&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;PopoverPanel&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With Headless UI, &lt;code&gt;unmount={false}&lt;/code&gt; renders the panel with &lt;code&gt;hidden&lt;/code&gt; and &lt;code&gt;display:none&lt;/code&gt;, and the links are in the HTML. This is the smallest change if your panel is light.&lt;/p&gt;

&lt;p&gt;Radix is different, and my first version of this post missed it (a reader caught it): &lt;code&gt;forceMount&lt;/code&gt; keeps the closed panel in the HTML but does not hide it. In NavigationMenu 1.4.1 the closed Content renders as a plain &lt;code&gt;div&lt;/code&gt; with &lt;code&gt;data-state="closed"&lt;/code&gt; and &lt;code&gt;pointer-events:none&lt;/code&gt;, with no &lt;code&gt;hidden&lt;/code&gt; attribute and no &lt;code&gt;display:none&lt;/code&gt;, so the server HTML paints every panel open. Add your own rule, scoped to your menu panels, such as &lt;code&gt;[data-state="closed"] { display: none }&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Always render the panel, hide it with CSS
&lt;/h3&gt;

&lt;p&gt;Render the panel every time and toggle visibility with a class (&lt;code&gt;hidden&lt;/code&gt; / &lt;code&gt;group-hover:block&lt;/code&gt;, or &lt;code&gt;visibility&lt;/code&gt; plus &lt;code&gt;opacity&lt;/code&gt; for a transition). It's simple, but every icon, description and decoration in the panel is now in every page's DOM, multiplied by the number of dropdowns. On a mega menu that adds up.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Render a light, hidden list of the same links (what I did)
&lt;/h3&gt;

&lt;p&gt;My panels have an icon tile and a description per link, plus gradient decorations. Rendering all three menus fully on every page would have added a few hundred elements, and keeping the home page's DOM small was something I'd already worked on. So the closed state renders one plain link per destination inside a &lt;code&gt;hidden&lt;/code&gt; element, and the full panel still only renders when opened:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Panel&lt;/span&gt; &lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="c1"&gt;// Closed: the same destinations as plain links, so they are in the server HTML.&lt;/span&gt;
  &lt;span class="c1"&gt;// One element per link - the heavy panel (icons, descriptions) still renders only when opened.&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sb"&gt;`nav-panel-${menu.key}`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;hidden&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Link&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;prefetch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Link&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;id&lt;/code&gt; matches the button's &lt;code&gt;aria-controls&lt;/code&gt;, so the button always points at a real element. &lt;code&gt;prefetch={false}&lt;/code&gt; stops Next.js from trying to prefetch these links, which matters less for hidden links, but there's no reason to load them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result:&lt;/strong&gt; the live home page went from &lt;strong&gt;4 to 11&lt;/strong&gt; unique links to &lt;code&gt;/services/&lt;/code&gt;, and its body grew from 1,122 to 1,159 elements (counted from the served HTML, scripts excluded). That's 37 elements for every link in three menus.&lt;/p&gt;

&lt;p&gt;These hidden links go to exactly the same pages a visitor gets by opening the menu. That's the line to stay on: don't add destinations or keyword-stuffed anchor text that people can't reach.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Use &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt;, or make the parent link do the work
&lt;/h3&gt;

&lt;p&gt;A native &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;&lt;/code&gt; keeps its content in the HTML when closed and needs no JavaScript. It works well for mobile menus. Whatever you choose, make the top-level label a real link to a hub page (&lt;code&gt;/services&lt;/code&gt;, &lt;code&gt;/tools&lt;/code&gt;) that links to every child page in plain HTML. Then even a fully JavaScript-only menu leaves a crawl path.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the fix did, and didn't do
&lt;/h2&gt;

&lt;p&gt;On the day I deployed, I checked the six service pages that had been slow to index, using Search Console's URL Inspection. Five were &lt;strong&gt;already indexed&lt;/strong&gt;, before Google could have seen the fix. Google had found them through the footer and the sitemap. One, website redesign, is "Crawled - currently not indexed", which means Google fetched it and decided not to index it. A missing link can't explain that, so the next step for that page is better content, not more links.&lt;/p&gt;

&lt;p&gt;So I'm not claiming this fix got pages indexed. What it does is make the header links real for every crawler. On a site with nine service pages, that's nine links from every page instead of zero. That's the main way a small site tells Google which pages matter. If the menu is the only place a page is linked, it's the difference between being found and not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt; your home page (or Ctrl+U) and grep for a path that only your dropdown links to.&lt;/li&gt;
&lt;li&gt;Missing? Find where the panel renders &lt;code&gt;null&lt;/code&gt; or &lt;code&gt;{open &amp;amp;&amp;amp; ...}&lt;/code&gt; when it's closed.&lt;/li&gt;
&lt;li&gt;Fix it with &lt;code&gt;forceMount&lt;/code&gt; / &lt;code&gt;unmount={false}&lt;/code&gt;, a CSS-hidden panel, or a light hidden list of the same links.&lt;/li&gt;
&lt;li&gt;Check the DOM size before and after. Lighthouse flags very large DOMs.&lt;/li&gt;
&lt;li&gt;Confirm in Search Console: URL Inspection → View crawled page → HTML.&lt;/li&gt;
&lt;li&gt;Make sure every top-level menu label links to a hub page that lists its children.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Related reading from my site's own clean-up: &lt;a href="https://knowledgemarkg.com/blog/pagespeed-100-mobile-nextjs-what-worked" rel="noopener noreferrer"&gt;PageSpeed 100 on mobile with Next.js: what worked&lt;/a&gt; and &lt;a href="https://knowledgemarkg.com/blog/reduce-unused-javascript-nextjs-lcp-render-delay" rel="noopener noreferrer"&gt;reducing unused JavaScript in Next.js&lt;/a&gt;. If you'd rather have someone check your site's crawlability, the &lt;a href="https://knowledgemarkg.com/website-audit" rel="noopener noreferrer"&gt;free website audit&lt;/a&gt; looks at links, speed and indexing in one pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does Google crawl links in a mega menu or dropdown menu?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes, if they are real &lt;code&gt;&amp;lt;a href&amp;gt;&lt;/code&gt; links in the page's HTML. If the menu only renders its panel after a hover or click, the links don't exist for Google, because Google renders JavaScript but doesn't interact with the page. Check with View Source or curl, not the DevTools Elements panel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are mega menus bad for SEO?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not by themselves. The common problem is technical: many React and JavaScript menus don't render their links until they are opened, so crawlers get no links at all. A menu whose links are in the HTML is a normal, crawlable navigation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Radix or shadcn/ui NavigationMenu render links for SEO?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my test (Radix NavigationMenu 1.4.1, server-rendered with React 19), the closed menu rendered 0 of 2 links. Adding forceMount to NavigationMenu.Content rendered both, but it does not hide the closed panel, so add CSS such as [data-state="closed"] { display: none }. shadcn/ui's Navigation Menu wraps the same Radix component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Headless UI render menu items when closed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not by default. In my test, Headless UI 2.2.10 Menu, Popover and Disclosure all rendered 0 of 2 links when closed. PopoverPanel with unmount={false} rendered both, hidden with display:none.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Google index links hidden with CSS or the hidden attribute?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Links hidden with CSS or the hidden attribute are still in the HTML, so Google can read them; that's the difference from a menu that isn't rendered at all. Keep hidden links to the same destinations users reach by opening the menu.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I check if Googlebot can see my menu links?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fetch the page without a browser (curl, or Ctrl+U for View Source) and search for a URL only your dropdown links to. Then confirm in Google Search Console with URL Inspection, View crawled page, HTML, which shows the HTML after Google rendered it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will adding hidden menu links make my page slower?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Slightly, so keep them light. On my home page, a plain hidden link per destination for three menus took the body from 1,122 to 1,159 elements. Rendering the full panels with icons and descriptions would have cost much more.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/mega-menu-seo-dropdown-links-not-in-html" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>react</category>
      <category>nextjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Can a Redacted PDF Be Unredacted? I Tested 4 Methods</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Sat, 21 Nov 2026 12:40:08 +0000</pubDate>
      <link>https://dev.to/kausarraza/can-a-redacted-pdf-be-unredacted-i-tested-4-methods-34di</link>
      <guid>https://dev.to/kausarraza/can-a-redacted-pdf-be-unredacted-i-tested-4-methods-34di</guid>
      <description>&lt;p&gt;Yes, often in seconds. Whether a redacted PDF can be unredacted depends entirely on how the redaction was done. A black box drawn on top of the text hides nothing: select it, copy it, paste it into Notepad and the words are back. A real redaction removes the text under the box, but even then the same name can sit on another page, in the file's properties or in a bookmark.&lt;/p&gt;

&lt;p&gt;I didn't want to repeat the usual warnings, so I built a test file and redacted it four different ways, then tried to get the hidden details back out. This is what came back, and how to check your own file before you send it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Black rectangle drawn on top:&lt;/strong&gt; fully recoverable by copy and paste.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Black box added as a comment (annotation):&lt;/strong&gt; fully recoverable. Delete the comment and the text reappears.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real redaction, saved over the original:&lt;/strong&gt; can be recoverable, because some saves append changes and keep the old version inside the file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real redaction saved as a new file, or the page burned into an image:&lt;/strong&gt; the covered text is gone. Anything you didn't cover, including the same details elsewhere in the file, is not.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The test file
&lt;/h2&gt;

&lt;p&gt;A two-page fake payslip: an employee name ("Jane Example"), a National Insurance number with the QQ prefix that is never issued to anyone, and an account number. The name appears again on page 2, in a line about who to contact. The file's Author and Title properties also contain the name, and it has one bookmark, "Jane Example - payslip". That is how real documents look: personal details are rarely in just one place.&lt;/p&gt;

&lt;p&gt;I created and checked every version with PyMuPDF (a PDF library for Python), counting how many times each detail could still be extracted as text. The last method was the live &lt;a href="https://knowledgemarkg.com/tools/redact-pdf" rel="noopener noreferrer"&gt;Redact PDF tool&lt;/a&gt; on this site, run in Chrome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results: what came back out
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Covered text recoverable?&lt;/th&gt;
&lt;th&gt;Name on page 2&lt;/th&gt;
&lt;th&gt;Metadata and bookmark&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Black rectangle drawn over the text&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Yes&lt;/strong&gt;: copy, paste and search all work&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Black square annotation (comment)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Yes&lt;/strong&gt;: delete the comment and it reappears&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Real redaction, saved as a new file&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Still there&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Real redaction, saved incrementally&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Yes&lt;/strong&gt;: the old version is still inside the file&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;td&gt;Still there&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Page burned into an image (Redact PDF tool)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Still there (page not marked)&lt;/td&gt;
&lt;td&gt;Removed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Only two of the five removed the covered text, and none of them removed the name on page 2, because I hadn't covered it. That last column is the one people forget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 1: a black box on top (copy and paste undoes it)
&lt;/h2&gt;

&lt;p&gt;Most PDF editors let you draw a filled rectangle. It looks perfect on screen and in print. But the page still contains the original text, with the rectangle painted over it. In my test file, all three details were still extractable as text after the boxes went on. Press Ctrl + A, then Ctrl + C, in any PDF viewer, paste into Notepad, and they appear in plain text.&lt;/p&gt;

&lt;p&gt;This is how most redaction failures make the news. In January 2019, a court filing by Paul Manafort's lawyers had black bars drawn over the text. Reporters copied and pasted the "redacted" passages and published them the same day. The same thing happens when text is highlighted in black in Word and then saved as a PDF: the highlight is formatting, and the words under it are untouched.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 2: a black comment (delete it and the text comes back)
&lt;/h2&gt;

&lt;p&gt;Some apps add the black box as an annotation, the same layer that holds sticky notes and highlights. That is even easier to undo. The text underneath was still extractable, and when I deleted the three annotations the name, NI number and account number were simply visible again on the page. Anyone who opens the comments panel can do the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 3: the incremental-save trap
&lt;/h2&gt;

&lt;p&gt;This one surprised me most. A PDF can be saved incrementally: instead of rewriting the file, the editor adds the changes to the end, and the original content stays in the file underneath. Viewers only show the newest version.&lt;/p&gt;

&lt;p&gt;I applied a real redaction (the kind that removes the text) and saved it that way, onto the original file. Opened normally, the redaction was perfect: no text under the boxes, nothing to copy. But the file now had two "end of file" markers. Cutting it at the first one gave me back the original, unredacted PDF, with every detail intact. No special software is needed, just a text editor and a minute.&lt;/p&gt;

&lt;p&gt;I haven't tested which desktop apps save this way and when, so I won't name any. The safe habit is the same either way: after redacting, use &lt;strong&gt;Save As&lt;/strong&gt; and create a new file, rather than saving over the original.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a real redaction still leaves behind
&lt;/h2&gt;

&lt;p&gt;Method 3, saved as a new file, removed the covered text properly. Method 5, which turns each marked page into an image with the black boxes burned in, did too. Here is what both still exposed, or could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The same details elsewhere.&lt;/strong&gt; In both files, "Jane Example" was still in the text on page 2. Redaction removes what you cover, not every mention. Search the whole document for each name and number before you finish.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File properties.&lt;/strong&gt; After the real redaction (method 3), the Author and Title fields still said "Jane Example", and so did the bookmark. The Redact PDF tool builds a new file and didn't carry either over: its output had no Author, Title or bookmarks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The file name.&lt;/strong&gt; The tool names its output after the original plus "-redacted". If the original was called &lt;em&gt;jane-example-payslip.pdf&lt;/em&gt;, rename it before you send it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The size of the box.&lt;/strong&gt; A box exactly the width of a name tells a reader how long the name was. Researchers showed in 2023 that the exact positions of the surrounding letters leak even more, enough to narrow a redacted name down from millions of candidates to a few hundred. Cover the whole field, label to margin, rather than the word alone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blur and pixelation.&lt;/strong&gt; These are not redaction. Bishop Fox released a tool, Unredacter, that recovers pixelated text when the font is known. Use solid black.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One more thing from my own test: my first attempt with the tool left "ple" from "Example" and the last digit of the account number showing, because I drew the boxes too tight. On the preview it looked covered. Check the downloaded file, not the preview.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check a redacted PDF before you send it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Copy everything.&lt;/strong&gt; Open the redacted PDF, press Ctrl + A then Ctrl + C (Cmd on a Mac), and paste into Notepad or TextEdit. If a redacted detail appears, the redaction failed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search for each detail.&lt;/strong&gt; Press Ctrl + F and search for every name, number and address you meant to remove, across the whole document.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extract the text another way.&lt;/strong&gt; Run the file through &lt;a href="https://knowledgemarkg.com/tools/pdf-to-text" rel="noopener noreferrer"&gt;PDF to Text&lt;/a&gt;, which runs in your browser and doesn't upload the file. It reads every text layer, including the ones a viewer hides.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open the properties.&lt;/strong&gt; In most viewers it is File &amp;gt; Properties (Ctrl + D in Adobe Reader). Check Title, Author, Subject and Keywords.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Look at the side panels.&lt;/strong&gt; Open the bookmarks and comments panels. A bookmark called "Smith v Jones - medical records" undoes a lot of careful redaction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the name of the file&lt;/strong&gt; you are about to attach.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to redact so it can't be undone
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adobe Acrobat Pro:&lt;/strong&gt; marking areas is only step one. Nothing is removed until you choose &lt;strong&gt;Apply&lt;/strong&gt;, and that dialog has a &lt;strong&gt;Sanitize and remove hidden information&lt;/strong&gt; option, which also clears metadata, comments and hidden layers. Turn it on. Then save under a new name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preview on a Mac:&lt;/strong&gt; use Tools &amp;gt; Redact, not a black shape from the markup toolbar. Apple says the redaction becomes permanent once you close the document. Some users have reported redacted text that was still searchable, so close the file, reopen it, and do the checks above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free, in the browser:&lt;/strong&gt; the &lt;a href="https://knowledgemarkg.com/tools/redact-pdf" rel="noopener noreferrer"&gt;Redact PDF tool&lt;/a&gt; burns the black boxes into an image of each marked page, so there is no text layer under them to recover, and the file never leaves your device. The trade-off: marked pages lose their selectable text, and the file grows. My test file went from 2.7 KB to 52.5 KB, which &lt;a href="https://knowledgemarkg.com/tools/compress-pdf" rel="noopener noreferrer"&gt;Compress PDF&lt;/a&gt; can bring down. To make the remaining text searchable again, run it through &lt;a href="https://knowledgemarkg.com/tools/ocr-pdf" rel="noopener noreferrer"&gt;OCR PDF&lt;/a&gt;. The black areas stay black.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whichever you use, cover every mention, cover whole fields rather than single words, save a new file, and run the checks. If the PDF won't let you redact at all because it is restricted, remove the restriction first with &lt;a href="https://knowledgemarkg.com/tools/unlock-pdf" rel="noopener noreferrer"&gt;Unlock PDF&lt;/a&gt;. If you are redacting a photo of a paper document, &lt;a href="https://knowledgemarkg.com/blog/how-to-convert-photo-to-pdf-free" rel="noopener noreferrer"&gt;turn the photo into a PDF&lt;/a&gt; first, then redact that.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can redacted PDFs be unredacted?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the redaction is only a black box or a black comment drawn over the text, yes: the text is still in the file and can be copied, searched or revealed by deleting the box. If the text was really removed, or the page was turned into an image with the boxes burned in, the covered text can't be recovered. But the same details can still be elsewhere in the file: on other pages, in the document properties or in bookmarks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can PDF redaction be undone?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A proper, applied redaction saved as a new file can't be undone. It can be undone if it was never applied (Acrobat marks areas first and only removes them when you apply), if it was just a shape or comment, or if the file was saved incrementally. In my test, cutting an incrementally saved file at its first end-of-file marker brought back the original, unredacted version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can I tell if a PDF redaction is real?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Select all the text, copy it and paste it into Notepad, then search the PDF for each redacted word. If anything comes back, the redaction is fake. Also check File &amp;gt; Properties for the title and author, the bookmarks and comments panels, and the file name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why can I still copy text from a redacted PDF?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because it was covered, not removed. A black rectangle, a black highlight in Word or a black comment only paints over the text. Redo it with a real redaction tool, starting from the original file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is blurring or pixelating text safe for redaction?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Security researchers have released tools that recover pixelated text when the font is known. Use solid black boxes, and cover the whole field, not just the word, so its length doesn't give it away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does redacting a PDF remove metadata?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not always. In my test, a real redaction left the author, title and a bookmark containing the person's name. Acrobat Pro can remove hidden information when you apply redactions. The Redact PDF tool on this site builds a new file and didn't carry the metadata or bookmarks over.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why can't I redact a PDF?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually because the free Adobe Reader has no redaction tool (it is part of Acrobat Pro), or because the PDF is restricted against editing. A free browser tool avoids the first problem. For the second, remove the restriction from a file you are entitled to edit, then redact.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/can-redacted-pdf-be-unredacted" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>pdf</category>
      <category>privacy</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>EADDRINUSE: Address Already in Use :::3000 (Fix on Windows)</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Sat, 21 Nov 2026 08:46:04 +0000</pubDate>
      <link>https://dev.to/kausarraza/eaddrinuse-address-already-in-use-3000-fix-on-windows-36mc</link>
      <guid>https://dev.to/kausarraza/eaddrinuse-address-already-in-use-3000-fix-on-windows-36mc</guid>
      <description>&lt;p&gt;You run &lt;code&gt;npm run dev&lt;/code&gt; or &lt;code&gt;node server.js&lt;/code&gt; and Node stops with &lt;code&gt;Error: listen EADDRINUSE: address already in use :::3000&lt;/code&gt;. It means exactly what it says: another process is already listening on port 3000. Most of the time that's an old copy of your own dev server that didn't shut down. The fix is to find that process and stop it, or to run on another port.&lt;/p&gt;

&lt;p&gt;On 21 November 2026 I reproduced it on a Windows 11 PC with Node 22.17.1 and a three-line HTTP server, and tried every way of finding and freeing the port. Two results surprised me: Windows let a second server start on the same port without any error, and a "permission denied" error that looks related turned out to be a port Windows had reserved. Every output below is copied from that test.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "EADDRINUSE: address already in use :::3000" means
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::3000
    at Server.setupListenHandle [as _listen2] (node:net:1940:16)
    at listenInCluster (node:net:1997:12)
    at Server.listen (node:net:2102:7)
    ...
  code: 'EADDRINUSE',
  errno: -4091,
  syscall: 'listen',
  address: '::',
  port: 3000
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;EADDRINUSE&lt;/code&gt; is the operating system refusing the &lt;code&gt;listen()&lt;/code&gt; call. &lt;code&gt;:::3000&lt;/code&gt; is not a typo: &lt;code&gt;::&lt;/code&gt; is the IPv6 "any address", and Node's default &lt;code&gt;listen(3000)&lt;/code&gt; binds it. On Windows that one socket also covers IPv4, which is why &lt;code&gt;netstat&lt;/code&gt; shows the port twice for the same process (below). If you see &lt;code&gt;0.0.0.0:3000&lt;/code&gt; or &lt;code&gt;127.0.0.1:3000&lt;/code&gt; instead, your code passed a host.&lt;/p&gt;

&lt;p&gt;The common causes, roughly in the order I'd check them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your previous dev server is still running.&lt;/strong&gt; A terminal tab you forgot, or a window you closed while the process kept going.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two projects want the same default port.&lt;/strong&gt; 3000 is the default for Next.js, Create React App, Express examples and many others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A watcher restarted too fast&lt;/strong&gt; (nodemon and similar) and the old process hadn't released the port yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fix it on Windows: find the PID, then stop it
&lt;/h2&gt;

&lt;p&gt;In Command Prompt, &lt;code&gt;netstat -ano&lt;/code&gt; lists every connection with its process ID (PID) in the last column. Filter it to the port, check what the PID is, then stop it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;netstat -ano | findstr :3000
  TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       88520
  TCP    [::]:3000              [::]:0                 LISTENING       88520

C:\&amp;gt;tasklist /FI "PID eq 88520"
Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
node.exe                     88520 Console                    1     31,148 K

C:\&amp;gt;taskkill /PID 88520 /F
SUCCESS: The process with PID 88520 has been terminated.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the &lt;code&gt;taskkill&lt;/code&gt;, &lt;code&gt;node server.js&lt;/code&gt; started on 3000 again. &lt;code&gt;/F&lt;/code&gt; forces it; check the image name with &lt;code&gt;tasklist&lt;/code&gt; first so you don't stop something you need. If the PID belongs to a service or a program you recognise, close it normally instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  The PowerShell version
&lt;/h3&gt;

&lt;p&gt;PowerShell has a cmdlet that returns the owning process directly, so you don't have to read columns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c1"&gt;# see who owns the port&lt;/span&gt;
&lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;NetTCPConnection&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;LocalPort&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;State&lt;/span&gt; &lt;span class="nc"&gt;Listen&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="nc"&gt;Select&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="nc"&gt;LocalAddress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;LocalPort&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;OwningProcess&lt;/span&gt;

&lt;span class="c1"&gt;# stop it (every process listening on 3000)&lt;/span&gt;
&lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;NetTCPConnection&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;LocalPort&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;State&lt;/span&gt; &lt;span class="nc"&gt;Listen&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="nc"&gt;Select&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExpandProperty&lt;/span&gt; &lt;span class="nc"&gt;OwningProcess&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Unique&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="k"&gt;ForEach&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Stop&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;Process&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Id&lt;/span&gt; &lt;span class="nv"&gt;$_&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Force&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;PassThru&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LocalAddress LocalPort OwningProcess
------------ --------- -------------
::                3000         88520
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second command found node (PID 87768 in that run) and stopped it, and nothing was listening on 3000 afterwards. It stops &lt;em&gt;every&lt;/em&gt; process listening on that port, so look at the first command's output before you run it.&lt;/p&gt;

&lt;h3&gt;
  
  
  In Git Bash, double the slashes
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;netstat -ano | findstr :3000&lt;/code&gt; works the same in Git Bash, but &lt;code&gt;taskkill&lt;/code&gt; doesn't. Git Bash converts arguments that start with &lt;code&gt;/&lt;/code&gt; into Windows paths, so &lt;code&gt;/PID&lt;/code&gt; becomes a folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;$ taskkill /PID 79808 /F
ERROR: Invalid argument/option - &lt;span class="s1"&gt;'C:/Program Files/Git/PID'&lt;/span&gt;.
Type &lt;span class="s2"&gt;"TASKKILL /?"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; usage.

$ taskkill //PID 79808 //F
SUCCESS: The process with PID 79808 has been terminated.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Writing &lt;code&gt;//PID&lt;/code&gt; and &lt;code&gt;//F&lt;/code&gt; stops the conversion. This is the "kill process on port windows git bash" problem in one line.&lt;/p&gt;

&lt;h3&gt;
  
  
  Or just use another port
&lt;/h3&gt;

&lt;p&gt;If you don't need 3000 specifically, change the port instead of stopping anything. Most tools read &lt;code&gt;PORT&lt;/code&gt;: &lt;code&gt;set PORT=3001&amp;amp;&amp;amp; npm start&lt;/code&gt; in cmd, &lt;code&gt;$env:PORT=3001; npm start&lt;/code&gt; in PowerShell. One cmd quirk: &lt;code&gt;set PORT=3001 &amp;amp;&amp;amp; ...&lt;/code&gt; stores &lt;code&gt;"3001 "&lt;/code&gt; with a trailing space. Node 22 still listened on 3001 when I tried it, but a stricter tool might not, so &lt;code&gt;set PORT=3001&amp;amp;&amp;amp; npm start&lt;/code&gt; (no space before &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;) is the safe spelling. Next.js picks a port for you, with a catch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\app&amp;gt;npx next dev
 ⚠ Port 3000 is in use by process 88580, using available port 3001 instead.
 ▲ Next.js 16.3.3 (Turbopack)
 - Local:         http://localhost:3001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\app&amp;gt;npx next dev -p 3000
 ⨯ Failed to start server
Error: listen EADDRINUSE: address already in use :::3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With plain &lt;code&gt;next dev&lt;/code&gt;, Next.js 16.3.3 moved to 3001 by itself and even named the PID holding 3000. With an explicit &lt;code&gt;-p 3000&lt;/code&gt; it refused and stopped with the same EADDRINUSE error. So if your &lt;code&gt;package.json&lt;/code&gt; script says &lt;code&gt;next dev -p 3000&lt;/code&gt;, you'll see the error; if it says &lt;code&gt;next dev&lt;/code&gt;, you'll get a warning and a different port, which is easy to miss if you keep a bookmark to &lt;code&gt;localhost:3000&lt;/code&gt; open.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: two servers on port 3000 and no error at all
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqitkdhxq8kxg4xg45lpt.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqitkdhxq8kxg4xg45lpt.webp" alt="Table of what happened when a second Node server listened on port 3000 on Windows: EADDRINUSE with the default host, but no error with 127.0.0.1 or 0.0.0.0, and EACCES on reserved ports" width="800" height="427"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Second Node server on port 3000, with the first one still running (Node 22.17.1, Windows 11).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is the one that cost me the most head-scratching. With the first server still running on the default &lt;code&gt;::&lt;/code&gt;, I started a second one with &lt;code&gt;listen(3000, "127.0.0.1")&lt;/code&gt;. It started. No EADDRINUSE. Then I tried &lt;code&gt;listen(3000, "0.0.0.0")&lt;/code&gt;, and that started too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;netstat -ano | findstr LISTENING | findstr :3000
  TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       4904
  TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       85268
  TCP    [::]:3000              [::]:0                 LISTENING       4904
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two different PIDs on &lt;code&gt;0.0.0.0:3000&lt;/code&gt;. Which server you reach then depends on the address you use: &lt;code&gt;http://localhost:3000&lt;/code&gt; went to the first server (localhost resolved to &lt;code&gt;::1&lt;/code&gt;, both for Node's HTTP client and for curl), and &lt;code&gt;http://127.0.0.1:3000&lt;/code&gt; went to the second. Only an exact repeat of the same address, &lt;code&gt;127.0.0.1&lt;/code&gt; twice, gave the expected &lt;code&gt;EADDRINUSE ... 127.0.0.1:3000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What this means in practice: if one of your apps sets a host (many configs use &lt;code&gt;HOST=127.0.0.1&lt;/code&gt; or &lt;code&gt;0.0.0.0&lt;/code&gt;) and an old copy is still running on the default, both run quietly, and the address in your browser decides which one you're looking at. The symptom is "my changes don't show up". I tested this with Node and curl, not with a browser, so I can't say which one a given browser picks for &lt;code&gt;localhost&lt;/code&gt;. The fix is the same as above: &lt;code&gt;netstat -ano | findstr :3000&lt;/code&gt; and look for more than one PID.&lt;/p&gt;

&lt;h2&gt;
  
  
  listen EACCES: permission denied (a different problem)
&lt;/h2&gt;

&lt;p&gt;This one looks related but isn't about a busy port. Windows keeps a list of excluded port ranges that no program may bind, and on this PC both 80 and 8086 were on it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;netsh int ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
        80          80
      2869        2869
      8086        8086
     50000       50059     *
     ...

* - Administered port exclusions.

C:\&amp;gt;set PORT=8086 &amp;amp;&amp;amp; node server.js
Error: listen EACCES: permission denied 0.0.0.0:8086
  code: 'EACCES',
  errno: -4092,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing was listening on 8086 or 80, and &lt;code&gt;netstat&lt;/code&gt; showed nothing. The ports were simply reserved. So when you see &lt;code&gt;EACCES&lt;/code&gt; on Windows, check &lt;code&gt;netsh int ipv4 show excludedportrange protocol=tcp&lt;/code&gt; before hunting for a process. The simplest fix is a port outside those ranges. Reservations are often linked to Hyper-V, WSL 2 or Docker; I didn't change anything on this machine, so I haven't tested removing one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the error easier to read next time
&lt;/h2&gt;

&lt;p&gt;The raw error is a stack trace from Node's internals. If you own the server code, catch it and print what to do instead (Express shown; plain &lt;code&gt;http&lt;/code&gt; servers work the same way):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Listening on ${PORT}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"EADDRINUSE"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Port ${PORT} is busy. Find it with: netstat -ano | findstr :${PORT}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS or Linux, the equivalent of the netstat step is &lt;code&gt;lsof -i :3000&lt;/code&gt; followed by &lt;code&gt;kill &amp;lt;PID&amp;gt;&lt;/code&gt;. I didn't test those here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;netstat -ano | findstr :3000&lt;/code&gt;, then &lt;code&gt;tasklist /FI "PID eq &amp;lt;PID&amp;gt;"&lt;/code&gt; to see what it is.&lt;/li&gt;
&lt;li&gt;Stop it: &lt;code&gt;taskkill /PID &amp;lt;PID&amp;gt; /F&lt;/code&gt; (cmd), &lt;code&gt;//PID&lt;/code&gt; and &lt;code&gt;//F&lt;/code&gt; in Git Bash, or &lt;code&gt;Stop-Process&lt;/code&gt; in PowerShell.&lt;/li&gt;
&lt;li&gt;More than one PID on the port? Two servers are running on different addresses.&lt;/li&gt;
&lt;li&gt;Or move: &lt;code&gt;PORT=3001&lt;/code&gt;, or let &lt;code&gt;next dev&lt;/code&gt; pick the next port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;EACCES&lt;/code&gt; instead of &lt;code&gt;EADDRINUSE&lt;/code&gt;? Check Windows' excluded port ranges.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Other Windows dev-setup errors I've worked through the same way: &lt;a href="https://knowledgemarkg.com/blog/npm-eresolve-legacy-peer-deps-vs-force" rel="noopener noreferrer"&gt;npm ERESOLVE: --legacy-peer-deps vs --force&lt;/a&gt;, and &lt;a href="https://knowledgemarkg.com/blog/install-n8n-on-windows-without-docker" rel="noopener noreferrer"&gt;installing n8n on Windows without Docker&lt;/a&gt;, which runs on &lt;code&gt;localhost:5678&lt;/code&gt; and hits this same error if a second copy is started.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does Error: listen EADDRINUSE: address already in use :::3000 mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another process is already listening on port 3000, so the operating system refused your server's listen() call. ':::3000' is the IPv6 any-address (::) on port 3000, which is what Node binds by default. Usually it's an old copy of your own dev server that is still running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I kill the process on port 3000 in Windows?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run netstat -ano | findstr :3000 in Command Prompt and note the PID in the last column. Check it with tasklist /FI "PID eq ", then stop it with taskkill /PID  /F. In PowerShell, Get-NetTCPConnection -LocalPort 3000 -State Listen shows the OwningProcess, and Stop-Process -Id  -Force stops it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does taskkill fail in Git Bash?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git Bash converts arguments that start with a slash into Windows paths, so /PID turns into C:/Program Files/Git/PID and taskkill reports 'Invalid argument/option'. Use double slashes: taskkill //PID  //F.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Port 3000 is already in use but nothing is running. Why?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run netstat -ano | findstr :3000: a background node.exe from a closed terminal or a watcher like nodemon often still holds it. If netstat shows nothing and the error is EACCES rather than EADDRINUSE, the port is probably in Windows' excluded port ranges; check with netsh int ipv4 show excludedportrange protocol=tcp.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can two servers run on the same port on Windows?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my test, yes. With one Node server on the default address (::), a second one started without error on 127.0.0.1:3000, and another on 0.0.0.0:3000. localhost reached the first server and 127.0.0.1 reached the second. Only binding exactly the same address twice gave EADDRINUSE.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does listen EACCES: permission denied mean on Windows?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The port can't be used at all, which is not the same as being busy. On my PC ports 80 and 8086 gave EACCES because they were in Windows' excluded port ranges, even though nothing was listening on them. Pick a port outside those ranges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I change the port instead of killing the process?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most Node tools read the PORT environment variable: set PORT=3001&amp;amp;&amp;amp; npm start in cmd (no space before &amp;amp;&amp;amp;), or $env:PORT=3001; npm start in PowerShell. Plain next dev moves to the next free port by itself and prints a warning; next dev -p 3000 fails instead.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/eaddrinuse-address-already-in-use-3000-windows" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>windows</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>npm ERESOLVE: --legacy-peer-deps vs --force (What Each Really Does)</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Fri, 20 Nov 2026 09:07:56 +0000</pubDate>
      <link>https://dev.to/kausarraza/npm-eresolve-legacy-peer-deps-vs-force-what-each-really-does-1n3p</link>
      <guid>https://dev.to/kausarraza/npm-eresolve-legacy-peer-deps-vs-force-what-each-really-does-1n3p</guid>
      <description>&lt;p&gt;npm has two messages with "ERESOLVE" in them, and they're easy to mix up. One is an &lt;strong&gt;error&lt;/strong&gt; and the install stops. The other is a &lt;strong&gt;warning&lt;/strong&gt; and the install carries on. The usual advice for both is "add &lt;code&gt;--legacy-peer-deps&lt;/code&gt;" or "add &lt;code&gt;--force&lt;/code&gt;", but the two flags don't do the same thing, and neither one fixes the conflict.&lt;/p&gt;

&lt;p&gt;I wanted to see exactly what each option does, so on 20 November 2026 I built a tiny conflict out of three local packages and installed it with npm 10.9.2, offline, so nothing came from the registry. A plugin wants &lt;code&gt;kmg-lib@^1.0.0&lt;/code&gt; as a peer dependency, and the project uses &lt;code&gt;kmg-lib@2.0.0&lt;/code&gt;. That's the same shape as a React 18 plugin in a React 19 app. Every output below is copied from that test. Where I couldn't observe something, I say so.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbdjzhx68banexqyvc0tk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbdjzhx68banexqyvc0tk.webp" alt="Table comparing npm ERESOLVE options: --legacy-peer-deps, --force, legacy-peer-deps in .npmrc, overrides and upgrading the package, with what each did in a local test with npm 10.9.2" width="799" height="451"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;What each option did with the same peer conflict (npm 10.9.2, local test).&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  ERESOLVE unable to resolve dependency tree (the error)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: case-a@1.0.0
npm error Found: kmg-lib@2.0.0
npm error node_modules/kmg-lib
npm error   kmg-lib@"file:../src/kmg-lib-2.0.0.tgz" from the root project
npm error
npm error Could not resolve dependency:
npm error peer kmg-lib@"^1.0.0" from kmg-plugin@1.0.0
npm error node_modules/kmg-plugin
npm error   kmg-plugin@"file:../src/kmg-plugin-1.0.0.tgz" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Read it bottom-up. &lt;code&gt;Could not resolve dependency&lt;/code&gt; names the package with the strict peer requirement: &lt;code&gt;kmg-plugin@1.0.0&lt;/code&gt; wants &lt;code&gt;kmg-lib@"^1.0.0"&lt;/code&gt;. &lt;code&gt;Found&lt;/code&gt; shows what you actually have: &lt;code&gt;kmg-lib@2.0.0&lt;/code&gt;, requested by "the root project", meaning your own &lt;code&gt;package.json&lt;/code&gt;. When both packages are your direct dependencies, npm refuses to pick a side, and you get this error and exit code 1.&lt;/p&gt;

&lt;p&gt;The last three lines are npm's own advice, and note its wording: retrying with a flag means accepting "an incorrect (and potentially broken) dependency resolution".&lt;/p&gt;
&lt;h2&gt;
  
  
  ERESOLVE overriding peer dependency (the warning)
&lt;/h2&gt;

&lt;p&gt;This one usually shows up without you asking for anything. When I ran &lt;code&gt;npx n8n&lt;/code&gt; earlier the same day, the install printed 32 of these and still finished with exit code 0:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @ai-sdk/anthropic@2.0.61
npm warn Found: zod@3.25.67
npm warn node_modules/zod
...
npm warn Could not resolve dependency:
npm warn peer zod@"^3.25.76 || ^4.1.8" from @ai-sdk/anthropic@2.0.61
npm warn node_modules/@ai-sdk/anthropic
npm warn   @ai-sdk/anthropic@"2.0.61" from n8n@2.22.6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is &lt;em&gt;where&lt;/em&gt; the conflict is. Here it's between two packages deep inside n8n's own dependency tree, not in your &lt;code&gt;package.json&lt;/code&gt;. For that case npm's docs describe the default behaviour: deep conflicts are "resolved using the nearest non-peer dependency specification", and when that happens "a warning is printed". So the warning means npm already chose a version for you that sits outside a package's stated peer range. My local reproduction, with the conflict inside a wrapper package, printed the same warning with no flag at all.&lt;/p&gt;

&lt;p&gt;If it's inside a package you installed, as with n8n, it's that package's maintainers' conflict. You can usually ignore it unless something actually breaks. If you set &lt;code&gt;--strict-peer-deps&lt;/code&gt;, npm treats this warning as a failure instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  What --legacy-peer-deps really does
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\case-a&amp;gt;npm install --legacy-peer-deps
added 2 packages in 1s

C:\case-a&amp;gt;npm ls --all
case-a@1.0.0
├── kmg-lib@2.0.0
└─┬ kmg-plugin@1.0.0
  └── kmg-lib@2.0.0 deduped invalid: "^1.0.0" from node_modules/kmg-plugin

npm error code ELSPROBLEMS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The install "worked" with exit code 0. Then &lt;code&gt;npm ls&lt;/code&gt; flagged the exact problem the error had warned about: &lt;code&gt;kmg-lib@2.0.0&lt;/code&gt; is &lt;code&gt;invalid&lt;/code&gt; for &lt;code&gt;kmg-plugin&lt;/code&gt;, and &lt;code&gt;npm ls&lt;/code&gt; itself exited with &lt;code&gt;ELSPROBLEMS&lt;/code&gt;. That matches the npm docs: the flag "causes npm to completely ignore &lt;code&gt;peerDependencies&lt;/code&gt; when building a package tree, as in npm versions 3 through 6", and its use "is not recommended".&lt;/p&gt;

&lt;p&gt;Putting &lt;code&gt;legacy-peer-deps=true&lt;/code&gt; in &lt;code&gt;.npmrc&lt;/code&gt; gave an identical result. It's the same flag, just applied to every install in that project, including your teammates' and your CI's. That's convenient, and it also hides every future peer conflict.&lt;/p&gt;

&lt;h2&gt;
  
  
  What --force really does
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\case-a&amp;gt;npm install --force
npm warn using --force Recommended protections disabled.
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: kmg-plugin@1.0.0
npm warn Found: kmg-lib@2.0.0
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--force&lt;/code&gt; opens with "Recommended protections disabled", and it's a much wider switch than the peer flag. According to npm's config docs it also allows installing packages whose &lt;code&gt;engines&lt;/code&gt; field asks for a different Node or npm version, lets &lt;code&gt;npm audit fix&lt;/code&gt; go outside your semver ranges (including major versions), and allows "conflicting peerDependencies to be installed in the root project". Instead of ignoring peers like &lt;code&gt;--legacy-peer-deps&lt;/code&gt;, it keeps them and overrides the conflict, which is why you see the same "overriding peer dependency" warning.&lt;/p&gt;

&lt;p&gt;One limit of my test: after the warnings, my offline sandbox stopped because npm tried to fetch the peer version from the registry, which a made-up package can't satisfy. So I saw how &lt;code&gt;--force&lt;/code&gt; starts, but not the tree it ends with. If you only need to get past a peer conflict, &lt;code&gt;--legacy-peer-deps&lt;/code&gt; is the narrower of the two.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fixes that actually remove the conflict
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Upgrade the package with the strict peer range.&lt;/strong&gt; This is the real fix. I added a &lt;code&gt;kmg-plugin@2.0.0&lt;/code&gt; whose peer range is &lt;code&gt;^1.0.0 || ^2.0.0&lt;/code&gt;. With &lt;code&gt;kmg-lib@2.0.0&lt;/code&gt; it installed cleanly and &lt;code&gt;npm ls&lt;/code&gt; exited 0, with no flags. To check whether a newer version supports your setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm view kmg-plugin versions
npm view kmg-plugin@latest peerDependencies
npm explain kmg-lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the newest version still doesn't list your version in &lt;code&gt;peerDependencies&lt;/code&gt;, look at the package's issue tracker. Support is often merged but not released yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Use &lt;code&gt;overrides&lt;/code&gt; when you know the newer version works.&lt;/strong&gt; This tells npm to give the plugin your own copy of the library, on purpose and in writing (version numbers simplified here; my test pointed at local tarballs):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"kmg-lib"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"kmg-plugin"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"overrides"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"kmg-plugin"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"kmg-lib"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"$kmg-lib"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\case-o&amp;gt;npm ls --all
case-o@1.0.0
├── kmg-lib@2.0.0 overridden
└─┬ kmg-plugin@1.0.0 overridden
  └── kmg-lib@2.0.0 deduped
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It installed without flags and &lt;code&gt;npm ls&lt;/code&gt; exited 0, marking both packages &lt;code&gt;overridden&lt;/code&gt;. Unlike &lt;code&gt;--legacy-peer-deps&lt;/code&gt;, the override is limited to the one package you named and it's recorded in &lt;code&gt;package.json&lt;/code&gt;, so the next person can see the decision. (&lt;code&gt;$kmg-lib&lt;/code&gt; means "the version of kmg-lib in my own dependencies".)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Downgrade the library&lt;/strong&gt; to a version inside the plugin's peer range, if you don't need the new major yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one should you use?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Warning ("overriding peer dependency") from a package you installed:&lt;/strong&gt; usually leave it. It's inside that package's tree.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error ("unable to resolve dependency tree"):&lt;/strong&gt; read the &lt;code&gt;Could not resolve dependency&lt;/code&gt; line, then upgrade that package if a version supports yours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No compatible version yet, and you've tested it works:&lt;/strong&gt; &lt;code&gt;overrides&lt;/code&gt; for that one package.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Need to get unblocked right now:&lt;/strong&gt; &lt;code&gt;--legacy-peer-deps&lt;/code&gt; for that one install. Run &lt;code&gt;npm ls&lt;/code&gt; afterwards so you know what's invalid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;--force&lt;/code&gt;:&lt;/strong&gt; last resort. It turns off more than peer checks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A related trap from the same day: npm also picks package versions based on your Node version without saying so. I hit it installing n8n, covered in &lt;a href="https://knowledgemarkg.com/blog/install-n8n-on-windows-without-docker" rel="noopener noreferrer"&gt;installing n8n on Windows without Docker&lt;/a&gt;. If npm itself is "not recognized", that's a PATH problem, and &lt;a href="https://knowledgemarkg.com/blog/python-is-not-recognized-as-an-internal-or-external-command" rel="noopener noreferrer"&gt;the Python version of that error&lt;/a&gt; walks through the same fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does npm ERESOLVE unable to resolve dependency tree mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two of your direct dependencies disagree about a peer dependency: one package wants a version range (for example ^1.0.0) and your package.json has a version outside it. The 'Could not resolve dependency' line names the strict package. Upgrading it to a version that supports yours is the real fix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does npm warn ERESOLVE overriding peer dependency mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;npm found a peer conflict deep inside your dependency tree and resolved it itself, using the nearest non-peer version, then printed a warning. The install continues. If the conflict is inside a package you installed, it's usually that package's issue; --strict-peer-deps turns the warning into an error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between --legacy-peer-deps and --force?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--legacy-peer-deps ignores peerDependencies completely, the way npm 3 to 6 did. --force keeps them but overrides conflicts, and also disables other protections, such as engines checks and audit fix staying inside your semver ranges. For a peer conflict, --legacy-peer-deps is the narrower option.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it safe to use --legacy-peer-deps?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It gets the install done, but it doesn't fix anything. In my test the install exited 0, then npm ls reported the peer as invalid. Use it to get unblocked, run npm ls to see what's invalid, and fix it with an upgrade or a targeted override.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should I put legacy-peer-deps=true in .npmrc?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Only as a deliberate, temporary choice. It behaves exactly like the flag but applies to every install in the project, including CI and teammates, and it hides future peer conflicts too. A scoped overrides entry in package.json is a narrower fix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I fix ERESOLVE without --force or --legacy-peer-deps?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Upgrade the package named in 'Could not resolve dependency' to a version whose peerDependencies include your version (check with npm view @latest peerDependencies). If none exists and you've tested it works, add an overrides entry for that package in package.json.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do npm ERESOLVE overriding peer dependency warnings break anything?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not necessarily. Installing n8n printed 32 of these warnings and still finished with exit code 0, and n8n started normally. They mean a package got a peer version outside its stated range, so if something does break, that package and version is the first place to look.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/npm-eresolve-legacy-peer-deps-vs-force" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>npm</category>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Install n8n on Windows Without Docker (and the Node Version Trap)</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Fri, 20 Nov 2026 08:46:25 +0000</pubDate>
      <link>https://dev.to/kausarraza/install-n8n-on-windows-without-docker-and-the-node-version-trap-5fhk</link>
      <guid>https://dev.to/kausarraza/install-n8n-on-windows-without-docker-and-the-node-version-trap-5fhk</guid>
      <description>&lt;p&gt;You can run n8n on Windows without Docker. With Node.js installed, this one command downloads it and starts the editor on &lt;code&gt;http://localhost:5678&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx n8n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's a catch the docs don't mention, and I only found it by running it. On 20 November 2026 the latest n8n was 2.48.6. On my Windows 11 PC with Node 22.17.1, &lt;code&gt;npx n8n&lt;/code&gt; installed &lt;strong&gt;2.22.6&lt;/strong&gt;, a release from June. It showed no error and no "please upgrade Node" message. It ran, and it was five months out of date.&lt;/p&gt;

&lt;p&gt;This post covers that trap, what the first start really looks like, and the problems you're likely to hit. Every output below is copied from my terminal, except where I say I read it from the npm registry instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: check your Node.js version first
&lt;/h2&gt;

&lt;p&gt;n8n is a Node.js app, so Node decides which n8n you get. Run these three commands before anything else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;node --version
v22.17.1

C:\&amp;gt;npm view n8n dist-tags.latest
2.48.6

C:\&amp;gt;npm view n8n@latest engines.node
&amp;gt;=24.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The third line is the important one. Since version 2.36.0 (18 August 2026), every n8n release needs &lt;strong&gt;Node 24 or newer&lt;/strong&gt;. The &lt;a href="https://docs.n8n.io/hosting/installation/npm/" rel="noopener noreferrer"&gt;npm install page in n8n's docs&lt;/a&gt; still said "n8n requires a Node.js version between 20.19 and 24.x, inclusive" when I read it. That matched older releases, but not the current one.&lt;/p&gt;

&lt;p&gt;If your Node is older, npm doesn't fail. It picks the newest n8n release whose &lt;code&gt;engines&lt;/code&gt; field accepts your Node and installs that instead. I worked out what that means for each Node version from the npm registry:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fff3oqsubsnpe87bq6h8g.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fff3oqsubsnpe87bq6h8g.webp" alt="Table: which n8n version npx installs for each Node.js version - Node 24 gets 2.48.6, Node 22.22 gets 2.35.7, Node 22.16 to 22.21 gets 2.22.6, Node 20.19 to 22.15 gets 2.8.4, Node 18.17 to 20.18 gets 1.97.1" width="800" height="403"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The n8n release npx falls back to for each Node.js version (npm registry, 20 Nov 2026).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So if you want current n8n, install Node 24 or newer from nodejs.org first, then open a new terminal so the new &lt;code&gt;node&lt;/code&gt; is the one on &lt;code&gt;PATH&lt;/code&gt;. I didn't upgrade Node on this PC, so I haven't run the Node 24 path myself.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: run it with npx
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;npx n8n&lt;/code&gt; downloads n8n into npm's cache and runs it, without a global install. The first run is slow. Mine took about ten and a half minutes and printed a wall of warnings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;npx --yes n8n --version
npm warn ERESOLVE overriding peer dependency
npm warn deprecated @langchain/community@1.1.27: This package has been deprecated...
(76 "deprecated" lines and 32 ERESOLVE warnings in total)
2.22.6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exit code was 0, and n8n started fine afterwards. The deprecation and peer-dependency warnings come from n8n's own dependencies, so you can't fix them and you don't need to. The only line that matters is the version number at the end. Compare it with the latest version from Step 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: the first start (don't close it early)
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;npx n8n&lt;/code&gt; without &lt;code&gt;--version&lt;/code&gt; to start it. Here's the startup log, shortened:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;npx n8n
No encryption key found - Auto-generating and saving to: C:\Users\you\.n8n\config
Initializing n8n process
n8n ready on ::, port 5678
Migrations in progress, please do NOT stop the process.
...
n8n Task Broker ready on 127.0.0.1, port 5679
Failed to start Python task runner in internal mode. because its virtual environment
is missing from this system. ...
Registered runner "JS Task Runner"
Version: 2.22.6

Editor is now accessible via:
http://localhost:5678
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four things in that log are worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Migrations run on the first start.&lt;/strong&gt; Mine ran 178 database migrations, and n8n says "please do NOT stop the process" while they run. The editor answered after about 30 seconds. Wait for the "Editor is now accessible" line before you open the browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your data lives in a &lt;code&gt;.n8n&lt;/code&gt; folder.&lt;/strong&gt; By default that's in your user folder. Mine held &lt;code&gt;config&lt;/code&gt; and &lt;code&gt;database.sqlite&lt;/code&gt;, because n8n uses SQLite out of the box, so no database server is needed. Workflows and credentials live in that database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The encryption key is generated once and saved in &lt;code&gt;.n8n\config&lt;/code&gt;.&lt;/strong&gt; Saved credentials are encrypted with it. If you back up or move &lt;code&gt;database.sqlite&lt;/code&gt;, take &lt;code&gt;config&lt;/code&gt; with it. Without the key, the credentials in that database can't be decrypted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Python task runner warning is about Python only.&lt;/strong&gt; The JavaScript runner registered and the editor worked. My reading is that Code nodes written in Python won't run in this setup, but I didn't test a Python Code node.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then open &lt;code&gt;http://localhost:5678&lt;/code&gt; in your browser. A fresh install starts by setting up an owner account, stored in the same local database. I only checked that the editor answered (its &lt;code&gt;/healthz&lt;/code&gt; endpoint returned &lt;code&gt;{"status":"ok"}&lt;/code&gt;), not the sign-up screen. To stop n8n, press Ctrl+C in the terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  npx or npm install -g?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;npx n8n&lt;/code&gt; is good for trying it. If you'll use n8n regularly, n8n's docs also give a global install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install n8n -g        &lt;span class="c"&gt;# install once&lt;/span&gt;
n8n start                 &lt;span class="c"&gt;# then start it any time (plain "n8n" works too)&lt;/span&gt;
npm update -g n8n         &lt;span class="c"&gt;# update later&lt;/span&gt;
npm install -g n8n@2.22.6 &lt;span class="c"&gt;# or pin a version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both follow the same Node rule, so a global install on old Node gets the same old release. One more thing from the same docs page: npm-based installs are "deprecated from n8n 3.0". For now npm works, but long term n8n is steering self-hosters towards Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  "n8n is not recognized" after npm install -g
&lt;/h2&gt;

&lt;p&gt;If &lt;code&gt;npm install n8n -g&lt;/code&gt; worked but &lt;code&gt;n8n start&lt;/code&gt; says &lt;code&gt;'n8n' is not recognized as an internal or external command&lt;/code&gt;, Windows can't find npm's global folder. Global packages land in &lt;code&gt;%AppData%\npm&lt;/code&gt;, and that folder has to be on your &lt;code&gt;PATH&lt;/code&gt;. It's the same PATH problem I took apart in &lt;a href="https://knowledgemarkg.com/blog/python-is-not-recognized-as-an-internal-or-external-command" rel="noopener noreferrer"&gt;'python' is not recognized&lt;/a&gt;, and the same fix applies: add the folder, then open a new terminal. Or skip the question and use &lt;code&gt;npx n8n&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Port 5678 is busy, or you want the data somewhere else
&lt;/h2&gt;

&lt;p&gt;n8n reads its settings from environment variables. &lt;code&gt;N8N_PORT&lt;/code&gt; changes the port and &lt;code&gt;N8N_USER_FOLDER&lt;/code&gt; moves the &lt;code&gt;.n8n&lt;/code&gt; folder. I used &lt;code&gt;N8N_USER_FOLDER&lt;/code&gt; for this test so nothing landed in my real user folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;:: cmd - use another port and keep data &lt;span class="k"&gt;in&lt;/span&gt; another folder
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nv"&gt;N8N_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5680
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nv"&gt;N8N_USER_FOLDER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;D:\n8n-data
npx n8n

&lt;span class="c"&gt;# PowerShell&lt;/span&gt;
&lt;span class="nv"&gt;$env&lt;/span&gt;:N8N_PORT &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"5680"&lt;/span&gt;
npx n8n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;n8n also opened a second port, 5679, for its task broker on &lt;code&gt;127.0.0.1&lt;/code&gt;, so that one has to be free too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webhooks from the internet won't reach localhost
&lt;/h2&gt;

&lt;p&gt;A local n8n is fine for scheduled workflows, manual runs and anything that calls out to APIs. It can't receive webhooks from outside services such as GitHub, Stripe or a form tool, because &lt;code&gt;localhost:5678&lt;/code&gt; isn't reachable from the internet. n8n's docs describe a cloudflared tunnel for local development, but on the npm page it needs Docker installed even for npm installs, and the docs say it isn't for production. If incoming webhooks are the point, you'll want n8n on a server or n8n Cloud in the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;node --version&lt;/code&gt;: 24 or newer for current n8n. Older Node quietly gets an older n8n.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npx n8n --version&lt;/code&gt;: compare the output with &lt;code&gt;npm view n8n dist-tags.latest&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;First start: wait for "Editor is now accessible", then open &lt;code&gt;http://localhost:5678&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Back up &lt;code&gt;.n8n\config&lt;/code&gt; together with &lt;code&gt;database.sqlite&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;"Not recognized" after a global install? Put &lt;code&gt;%AppData%\npm&lt;/code&gt; on PATH, or use npx.&lt;/li&gt;
&lt;li&gt;Need webhooks from the internet? Plan for a server, not localhost.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your next step is running AI models on the same machine, my guide to &lt;a href="https://knowledgemarkg.com/blog/how-to-run-deepseek-r1-locally-for-free-on-macwindowslinux" rel="noopener noreferrer"&gt;running DeepSeek R1 locally&lt;/a&gt; covers the model side.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can I install n8n on Windows without Docker?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Install Node.js, then run npx n8n in cmd or PowerShell. It downloads n8n and starts the editor on &lt;a href="http://localhost:5678" rel="noopener noreferrer"&gt;http://localhost:5678&lt;/a&gt;. For regular use, npm install n8n -g and then n8n start does the same with a permanent install.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Node.js version does n8n need?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Current n8n releases need Node 24 or newer (every release since 2.36.0, August 2026). n8n's npm install page still says 20.19 to 24.x, which matches older releases. On older Node, npm installs the newest older release your Node supports instead of failing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does npx n8n install an old version?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;npm picks the newest n8n whose engines field accepts your Node version. On Node 22.17.1, npx n8n installed 2.22.6 from June 2026 while the latest was 2.48.6. Upgrade Node to 24 or newer, open a new terminal, and run npx n8n again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is n8n free to run locally?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Running n8n on your own PC through npx or npm costs nothing; you need Node.js and your own machine. Check n8n's licence page for commercial and hosted use, which has its own terms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where does n8n store its data on Windows?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a .n8n folder, by default in your user folder. It holds config (with the encryption key for saved credentials) and database.sqlite (workflows, credentials, executions). Set N8N_USER_FOLDER to move it, and back up config with the database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How long does npx n8n take the first time?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On my PC the first npx n8n --version took about ten and a half minutes, mostly downloading dependencies. The first start then ran 178 database migrations and the editor answered after about 30 seconds. Later starts reuse npm's cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does 'n8n' say not recognized after npm install -g?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;npm's global folder, %AppData%\npm, isn't on your PATH, or the terminal was opened before the install. Add the folder to PATH and open a new terminal, or run it as npx n8n instead.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/install-n8n-on-windows-without-docker" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>n8n</category>
      <category>automation</category>
      <category>windows</category>
      <category>node</category>
    </item>
    <item>
      <title>'python' Is Not Recognized as an Internal or External Command: Every Fix</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Fri, 20 Nov 2026 06:07:19 +0000</pubDate>
      <link>https://dev.to/kausarraza/python-is-not-recognized-as-an-internal-or-external-command-every-fix-3ii7</link>
      <guid>https://dev.to/kausarraza/python-is-not-recognized-as-an-internal-or-external-command-every-fix-3ii7</guid>
      <description>&lt;p&gt;You install Python on Windows, open a terminal, type &lt;code&gt;python&lt;/code&gt; and get this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;python --version
'python' is not recognized as an internal or external command,
operable program or batch file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It almost never means Python failed to install. It means the terminal looked in every folder on your &lt;code&gt;PATH&lt;/code&gt; and none of them had a &lt;code&gt;python.exe&lt;/code&gt; in it. The fix depends on which of five similar messages you have, so this post starts there.&lt;/p&gt;

&lt;p&gt;I reproduced each one on 20 November 2026 on a Windows 11 PC that has Python 3.13 (classic installer) and Python 3.14 (the new Python install manager) side by side. I didn't change any system settings. Instead I ran each command with a cut-down &lt;code&gt;PATH&lt;/code&gt;, so every output below is copied from a real terminal. The one exception is the Microsoft Store message, which I couldn't trigger on this PC. That's explained in its section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5en7dx5fonf2guiwxzav.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5en7dx5fonf2guiwxzav.webp" alt="Table of five Windows messages: python is not recognized in cmd, the PowerShell cmdlet message, Python was not found Microsoft Store, pip is not recognized, and No module named after pip install, with the meaning and fix for each" width="799" height="451"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The five messages, what each means and the fix.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  First, check whether Python is installed at all
&lt;/h2&gt;

&lt;p&gt;Before you touch any settings, try the launcher:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;py --version
Python 3.14.3

C:\&amp;gt;py -c "import sys; print(sys.executable)"
C:\Users\you\AppData\Local\Python\pythoncore-3.14-64\python.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With my &lt;code&gt;PATH&lt;/code&gt; stripped down to just &lt;code&gt;C:\Windows&lt;/code&gt;, &lt;code&gt;python&lt;/code&gt; failed but &lt;code&gt;py&lt;/code&gt; still worked. On this PC the classic installer's launcher is &lt;code&gt;C:\Windows\py.exe&lt;/code&gt;, a folder that is always on &lt;code&gt;PATH&lt;/code&gt;, and the install manager provides &lt;code&gt;py&lt;/code&gt; as an app alias. If &lt;code&gt;py&lt;/code&gt; answers, Python is installed and only &lt;code&gt;PATH&lt;/code&gt; is wrong. The second command prints where the real &lt;code&gt;python.exe&lt;/code&gt; lives, and that folder is what you'll add. If &lt;code&gt;py&lt;/code&gt; is also "not recognized", Python isn't installed. Get it from python.org (next section) rather than searching for a fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  'python' is not recognized as an internal or external command (cmd)
&lt;/h2&gt;

&lt;p&gt;This is cmd's wording. Python is installed, but its folder isn't on &lt;code&gt;PATH&lt;/code&gt;, usually because the "Add python.exe to PATH" box in the installer wasn't ticked. You have two ways out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Just use &lt;code&gt;py&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;py script.py&lt;/code&gt;, &lt;code&gt;py -m pip install ...&lt;/code&gt; and &lt;code&gt;py -m venv .venv&lt;/code&gt; all work without any &lt;code&gt;PATH&lt;/code&gt; change. For many people this is the whole fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add the folder to &lt;code&gt;PATH&lt;/code&gt;.&lt;/strong&gt; Press Start, type "environment variables", open &lt;em&gt;Edit environment variables for your account&lt;/em&gt;, select &lt;code&gt;Path&lt;/code&gt;, click Edit, then New, and add the folder that &lt;code&gt;sys.executable&lt;/code&gt; printed. The usual folders are:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python install manager (python.org's recommended installer since 3.14)
%LocalAppData%\Python\bin

# classic python.org installer, "just for me"
%LocalAppData%\Programs\Python\Python313
%LocalAppData%\Programs\Python\Python313\Scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then close the terminal and open a new one. A terminal reads &lt;code&gt;PATH&lt;/code&gt; once, when it starts, so the old window keeps saying "not recognized" even after the fix is correct. That catches a lot of people.&lt;/p&gt;

&lt;p&gt;The Python docs now recommend the &lt;strong&gt;Python install manager&lt;/strong&gt; from python.org. They say the traditional full installer is "deprecated since 3.14 and will not be produced for Python 3.16 or later". The install manager asks once whether to add &lt;code&gt;%LocalAppData%\Python\bin&lt;/code&gt; to &lt;code&gt;PATH&lt;/code&gt;. Say yes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The term 'python' is not recognized as the name of a cmdlet (PowerShell)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PS C:\&amp;gt; python --version
python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
    + CategoryInfo          : ObjectNotFound: (python:String) [], CommandNotFoundException
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same cause, PowerShell's wording: &lt;code&gt;CommandNotFoundException&lt;/code&gt; means no folder on &lt;code&gt;PATH&lt;/code&gt; holds a &lt;code&gt;python.exe&lt;/code&gt;. The fixes are the same as above. One PowerShell-only trap: if Python's folder &lt;em&gt;is&lt;/em&gt; on &lt;code&gt;PATH&lt;/code&gt; and you still get this, check that you aren't typing &lt;code&gt;python3&lt;/code&gt;. The classic installer doesn't create a &lt;code&gt;python3.exe&lt;/code&gt;. The install manager does, but its docs say it is "not meant to be widely used or recommended". On Windows, use &lt;code&gt;python&lt;/code&gt; or &lt;code&gt;py&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Python was not found; run without arguments to install from the Microsoft Store"
&lt;/h2&gt;

&lt;p&gt;This message comes from Windows, not from Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Python was not found; run without arguments to install from the Microsoft Store,
or disable this shortcut from Settings &amp;gt; Manage App Execution Aliases.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Windows ships a &lt;code&gt;python.exe&lt;/code&gt; placeholder in &lt;code&gt;%LocalAppData%\Microsoft\WindowsApps&lt;/code&gt;, which is on &lt;code&gt;PATH&lt;/code&gt; by default. If no real Python comes earlier in &lt;code&gt;PATH&lt;/code&gt;, the placeholder runs. With arguments it prints this message, and with none it opens the Store page. I couldn't reproduce it here because on this PC the WindowsApps aliases point at the installed Python install manager, which is how the install manager provides &lt;code&gt;python&lt;/code&gt; and &lt;code&gt;py&lt;/code&gt;. So the text above is Windows' own message, quoted as users report it.&lt;/p&gt;

&lt;p&gt;The fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No Python installed:&lt;/strong&gt; install the Python install manager from python.org. Its aliases replace the placeholder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python installed with the classic installer:&lt;/strong&gt; put its folder &lt;em&gt;above&lt;/em&gt; WindowsApps in &lt;code&gt;Path&lt;/code&gt;, or open Start, search "Manage app execution aliases" and switch off the two "App Installer python.exe / python3.exe" entries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using the install manager and &lt;code&gt;python&lt;/code&gt; still opens the Store:&lt;/strong&gt; the Python docs' advice is to open "Manage app execution aliases" and make sure the "Python (default)" aliases are on. If they already are, switch them off and on again. Also check that WindowsApps is still on &lt;code&gt;PATH&lt;/code&gt;, because the install manager's commands live there.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  'pip' is not recognized as an internal or external command
&lt;/h2&gt;

&lt;p&gt;This one has its own cause. I put &lt;code&gt;C:\Python313&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt; but left out its &lt;code&gt;Scripts&lt;/code&gt; folder, which is a common half-finished manual fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;python --version
Python 3.13.5

C:\&amp;gt;pip --version
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\&amp;gt;python -m pip --version
pip 25.3 from C:\Python313\Lib\site-packages\pip (python 3.13)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pip.exe&lt;/code&gt; lives in &lt;code&gt;Scripts&lt;/code&gt;, not next to &lt;code&gt;python.exe&lt;/code&gt;. You can add &lt;code&gt;Scripts&lt;/code&gt; to &lt;code&gt;PATH&lt;/code&gt; as well, but there's a better habit: always run pip through Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install requests        &lt;span class="c"&gt;# installs for exactly the python you run&lt;/span&gt;
py -3.14 -m pip install requests      &lt;span class="c"&gt;# or pick the version explicitly&lt;/span&gt;
python -m pip --version               &lt;span class="c"&gt;# shows which Python pip belongs to&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;python -m pip&lt;/code&gt; works whenever &lt;code&gt;python&lt;/code&gt; works, and it can't install into the wrong Python. That second point matters, as the next section shows.&lt;/p&gt;

&lt;h2&gt;
  
  
  pip install worked, but "No module named ..." anyway
&lt;/h2&gt;

&lt;p&gt;If you have more than one Python, &lt;code&gt;python&lt;/code&gt;, &lt;code&gt;py&lt;/code&gt; and &lt;code&gt;pip&lt;/code&gt; can each point at a different one. On my PC:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;where python
C:\Python313\python.exe
C:\Users\you\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\you\AppData\Local\Python\bin\python.exe

C:\&amp;gt;python --version
Python 3.13.5

C:\&amp;gt;py --version
Python 3.14.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;python&lt;/code&gt; runs 3.13, because &lt;code&gt;C:\Python313&lt;/code&gt; comes first in &lt;code&gt;PATH&lt;/code&gt;. &lt;code&gt;py&lt;/code&gt; runs 3.14, the install manager's default. And &lt;code&gt;pip&lt;/code&gt; is 3.13's. Pillow is installed for 3.13 only, so the same two-line script behaves differently depending on the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\&amp;gt;python check.py
PIL 10.4.0

C:\&amp;gt;py check.py
Traceback (most recent call last):
  File "check.py", line 1, in &amp;lt;module&amp;gt;
    import PIL
ModuleNotFoundError: No module named 'PIL'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing is broken. The package was installed for one interpreter and the script ran on the other. The fix is &lt;code&gt;python -m pip&lt;/code&gt; (or &lt;code&gt;py -m pip&lt;/code&gt;) with the same command you use to run the script, and &lt;code&gt;where python&lt;/code&gt; shows you which Python runs first. A virtual environment removes the question entirely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;py -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside an activated venv, &lt;code&gt;python&lt;/code&gt; and &lt;code&gt;pip&lt;/code&gt; both belong to the venv, whatever &lt;code&gt;PATH&lt;/code&gt; says.&lt;/p&gt;

&lt;h2&gt;
  
  
  Python not recognized in the VS Code terminal
&lt;/h2&gt;

&lt;p&gt;VS Code's integrated terminal inherits &lt;code&gt;PATH&lt;/code&gt; from VS Code, and VS Code read it when it started. If you changed &lt;code&gt;PATH&lt;/code&gt; while VS Code was open, close &lt;em&gt;all&lt;/em&gt; VS Code windows and start it again. Opening a new terminal tab isn't enough. If it still fails, open a normal cmd window and run &lt;code&gt;where python&lt;/code&gt;. If it fails there too, the problem is &lt;code&gt;PATH&lt;/code&gt;, not VS Code. For running and debugging, VS Code uses the interpreter you choose with &lt;em&gt;Python: Select Interpreter&lt;/em&gt; (Ctrl+Shift+P). Pick the same one you install packages into.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;py --version&lt;/code&gt; works? Python is installed. Use &lt;code&gt;py&lt;/code&gt;, or add the folder from &lt;code&gt;sys.executable&lt;/code&gt; to &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Changed &lt;code&gt;PATH&lt;/code&gt;? Open a new terminal, or restart VS Code completely.&lt;/li&gt;
&lt;li&gt;Store message? Install Python from python.org, or fix the app execution aliases.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pip&lt;/code&gt; not recognized? Use &lt;code&gt;python -m pip&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;"No module named" after installing? Compare &lt;code&gt;where python&lt;/code&gt; with &lt;code&gt;python -m pip --version&lt;/code&gt;, or use a venv.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once Python runs, local AI tools are a common next step. My guide to &lt;a href="https://knowledgemarkg.com/blog/how-to-run-deepseek-r1-locally-for-free-on-macwindowslinux" rel="noopener noreferrer"&gt;running DeepSeek R1 locally on Windows, macOS and Linux&lt;/a&gt; picks up from there.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why is python not recognized as an internal or external command?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Windows can't find python.exe in any folder on your PATH. Python is usually installed, but its folder wasn't added, often because the 'Add python.exe to PATH' box was unticked. Try py --version: if it works, either use py or add Python's folder to PATH and open a new terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I add Python to PATH on Windows 11?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run py -c "import sys; print(sys.executable)" to find the folder. Then open Start, search 'environment variables', choose 'Edit environment variables for your account', edit Path, add that folder (and its Scripts folder for pip), and open a new terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does 'Python was not found; run without arguments to install from the Microsoft Store' mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Windows ran its placeholder python.exe from the WindowsApps folder because no real Python came earlier on PATH. Install Python from python.org, or if Python is already installed, move its folder above WindowsApps in Path or turn off the python.exe app execution aliases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is pip not recognized when python works?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;pip.exe is in Python's Scripts folder, which is a separate PATH entry. Use python -m pip install requests (or any package name) instead. It always uses the same Python you run, so packages can't end up in a different interpreter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between py and python on Windows?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;python runs whichever python.exe comes first on PATH. py is the launcher, which picks an installed version itself (the newest or the configured default) and accepts -3.13 or -V:3.14 to choose. On a PC with two versions they can run different Pythons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do I get No module named after pip install?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;pip installed the package into a different Python than the one running your script. Run pip as python -m pip (or py -m pip) using the same command you run the script with, check with where python, or use a virtual environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is python still not recognized in VS Code after fixing PATH?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VS Code reads PATH when it starts, and its terminals inherit that copy. Close every VS Code window and reopen it. Also select the interpreter with Python: Select Interpreter so running and debugging use the same Python.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/python-is-not-recognized-as-an-internal-or-external-command" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>windows</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Git Push Rejected: Fix 'Failed to Push Some Refs' (Every Cause)</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Fri, 20 Nov 2026 05:34:25 +0000</pubDate>
      <link>https://dev.to/kausarraza/git-push-rejected-fix-failed-to-push-some-refs-every-cause-36f</link>
      <guid>https://dev.to/kausarraza/git-push-rejected-fix-failed-to-push-some-refs-every-cause-36f</guid>
      <description>&lt;p&gt;"error: failed to push some refs to" is Git's catch-all line for "the server didn't accept your push". It tells you nothing on its own. The useful part is the label in brackets one line above it: &lt;code&gt;(fetch first)&lt;/code&gt;, &lt;code&gt;(non-fast-forward)&lt;/code&gt;, &lt;code&gt;(stale info)&lt;/code&gt;, &lt;code&gt;(already exists)&lt;/code&gt; or &lt;code&gt;[remote rejected]&lt;/code&gt;. Each label has a different cause and a different fix, and only one of them is ever fixed by forcing.&lt;/p&gt;

&lt;p&gt;To get the messages right I reproduced every case on 20 November 2026 with Git 2.51.0, using local test repositories and a bare repository as the remote. GitHub, GitLab and Bitbucket print the same client-side lines, because they come from your Git, not from the server. Repository URLs below are shortened to &lt;code&gt;github.com:you/app.git&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6s2a1rzcvc09u0tsdb0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6s2a1rzcvc09u0tsdb0.webp" alt="Table of git push rejection labels: fetch first, non-fast-forward, stale info, remote ref updated since checkout, already exists, remote rejected, and src refspec does not match any, with the cause and fix for each"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Every label Git printed in the test repositories, with the cause and the fix.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  (fetch first): the remote has commits you don't have
&lt;/h2&gt;

&lt;p&gt;This is the most common one. Someone else pushed, or you pushed from another machine, or you edited a file on GitHub's website, so the remote branch has a commit your clone has never seen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git push origin main
To github.com:you/app.git
 ! [rejected]        main -&amp;gt; main (fetch first)
error: failed to push some refs to 'github.com:you/app.git'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git refuses because accepting your push would throw that commit away. The fix is to bring it in first. I prefer a rebase here, because it puts your local commits on top and keeps the history in a straight line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull --rebase origin main
&lt;span class="c"&gt;# fix any conflicts, then: git add &amp;lt;file&amp;gt; &amp;amp;&amp;amp; git rebase --continue&lt;/span&gt;
git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A plain &lt;code&gt;git pull&lt;/code&gt; (merge) also works and creates a merge commit. Both are safe. What you should not do is &lt;code&gt;git push --force&lt;/code&gt;. That deletes the other commit from the remote, and nobody gets a warning.&lt;/p&gt;

&lt;h2&gt;
  
  
  (non-fast-forward): your branch and the remote have diverged
&lt;/h2&gt;

&lt;p&gt;Same root cause, different wording. You get &lt;code&gt;(non-fast-forward)&lt;/code&gt; instead of &lt;code&gt;(fetch first)&lt;/code&gt; when your clone already &lt;em&gt;knows&lt;/em&gt; about the remote commit (you ran &lt;code&gt;git fetch&lt;/code&gt;, or an editor did it for you) but your branch doesn't contain it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ! [rejected]        main -&amp;gt; main (non-fast-forward)
error: failed to push some refs to 'github.com:you/app.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;$ git status -sb
&lt;span class="c"&gt;## main...origin/main [ahead 1, behind 1]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"ahead 1, behind 1" means you have one commit the remote doesn't, and the remote has one you don't. The fix is the same &lt;code&gt;git pull --rebase&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The other way to get this message is to change commits you've already pushed: &lt;code&gt;git commit --amend&lt;/code&gt;, an interactive rebase, a squash, or &lt;code&gt;git reset&lt;/code&gt;. In my test, amending a pushed commit produced exactly the message above. Here the remote isn't ahead of you. Your new commit simply replaces the old one instead of building on it. If the branch is yours alone, such as a feature branch for a pull request, the fix is a careful force push (next section). If others use the branch, don't rewrite it. Make a new commit instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Need to specify how to reconcile divergent branches"
&lt;/h2&gt;

&lt;p&gt;When you follow the hint and run &lt;code&gt;git pull&lt;/code&gt;, current Git may stop with this instead of pulling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hint: You have divergent branches and need to specify how to reconcile them.
...
fatal: Need to specify how to reconcile divergent branches.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git won't guess whether you want a merge or a rebase. Pick one once and it stops asking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config --global pull.rebase &lt;span class="kc"&gt;true&lt;/span&gt;   &lt;span class="c"&gt;# rebase your local commits on top&lt;/span&gt;
&lt;span class="c"&gt;# or&lt;/span&gt;
git config --global pull.ff only       &lt;span class="c"&gt;# refuse anything but a fast-forward&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A detail that confused me while testing on Windows: Git for Windows writes &lt;code&gt;pull.rebase false&lt;/code&gt; into its system-wide config during installation. On a default Windows install, &lt;code&gt;git pull&lt;/code&gt; quietly makes a merge commit and you never see this message. Without that setting, you get the message above. Run &lt;code&gt;git config --show-origin --get-regexp pull&lt;/code&gt; to see what applies on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Force pushing safely: --force-with-lease and --force-if-includes
&lt;/h2&gt;

&lt;p&gt;After a rebase or an amend on your own branch, a force push is the right tool. Just don't use bare &lt;code&gt;--force&lt;/code&gt;. Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push --force-with-lease --force-if-includes origin my-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--force-with-lease&lt;/code&gt; only overwrites the remote branch if it is still where your last fetch saw it. When someone had pushed in the meantime, my test push was refused with a new label:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ! [rejected]        main -&amp;gt; main (stale info)
error: failed to push some refs to 'github.com:you/app.git'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;(stale info)&lt;/code&gt; means "the remote moved since you last looked". Fetch, look at what arrived (&lt;code&gt;git log HEAD..origin/my-branch&lt;/code&gt;), and rebase onto it before you try again.&lt;/p&gt;

&lt;p&gt;There is a trap here, and my test hit it. If you run &lt;code&gt;git fetch&lt;/code&gt; first, your view of the remote is up to date, so &lt;code&gt;--force-with-lease&lt;/code&gt; lets the push through, even though you never looked at the new commit. In the test, that push deleted the other person's commit. Many editors fetch in the background, so this happens without you running anything. &lt;code&gt;--force-if-includes&lt;/code&gt; (Git 2.30 and later) closes that gap. It also checks that the remote commit is part of your branch's history, and the same push was refused:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ! [rejected]        main -&amp;gt; main (remote ref updated since checkout)
error: failed to push some refs to 'github.com:you/app.git'
hint: Updates were rejected because the tip of the remote-tracking branch has
hint: been updated since the last checkout.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make that the default, set &lt;code&gt;git config --global push.useForceIfIncludes true&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  (already exists): a tag with that name is on the remote
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ! [rejected]        v1.0 -&amp;gt; v1.0 (already exists)
error: failed to push some refs to 'github.com:you/app.git'
hint: Updates were rejected because the tag already exists in the remote.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tags are meant to stay put. If you moved a tag locally (&lt;code&gt;git tag -f v1.0&lt;/code&gt;) and push it, Git refuses. The clean fix is a new version number, &lt;code&gt;v1.0.1&lt;/code&gt;. If you really need to move a published tag, for example because nobody has used the release yet, push it with &lt;code&gt;git push --force origin v1.0&lt;/code&gt;, and tell everyone who fetched it, because their clones keep the old one.&lt;/p&gt;

&lt;h2&gt;
  
  
  [remote rejected]: the server's rules said no
&lt;/h2&gt;

&lt;p&gt;Note the different wording: &lt;code&gt;[remote rejected]&lt;/code&gt; instead of &lt;code&gt;[rejected]&lt;/code&gt;. Your Git was happy to push. The server received the commits and then refused them. The reason is in the lines that start with &lt;code&gt;remote:&lt;/code&gt;, just above. In my test a server-side hook printed one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;remote: main is protected: open a pull request
To github.com:you/app.git
 ! [remote rejected] main -&amp;gt; main (pre-receive hook declined)
error: failed to push some refs to 'github.com:you/app.git'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On hosted Git, the usual causes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A protected branch.&lt;/strong&gt; Direct pushes to &lt;code&gt;main&lt;/code&gt; are blocked, or force pushes are. Push to a new branch and open a pull request: &lt;code&gt;git switch -c fix-login&lt;/code&gt;, then &lt;code&gt;git push -u origin fix-login&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A secret in a commit.&lt;/strong&gt; GitHub's push protection blocks pushes that contain things like access tokens and lists the commit and file path in the &lt;code&gt;remote:&lt;/code&gt; lines. Removing the secret in a new commit is not enough, because it is still in the old commit. Take it out of history (below), then rotate the key, because it has left your machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A file that is too big.&lt;/strong&gt; GitHub blocks files larger than 100 MiB and warns from 50 MiB. As with secrets, deleting the file in a later commit doesn't help. Remove it from the commit that added it, or use Git LFS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No permission.&lt;/strong&gt; You can read the repository but not write to it, or you are signed in as a different account. Check with &lt;code&gt;git remote -v&lt;/code&gt; which URL you are pushing to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the secret or the big file is only in your last commit, amending is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# the secret is only in the last commit&lt;/span&gt;
git rm --cached .env
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;".env"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .gitignore
git commit --amend --all --no-edit
git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it is further back, start an interactive rebase from the parent of the commit that added it, mark that commit as &lt;code&gt;edit&lt;/code&gt;, remove the file, and continue. The same pattern stops a &lt;code&gt;.env&lt;/code&gt; file being committed in the first place. My post on &lt;a href="https://knowledgemarkg.com/blog/nextjs-env-local-overrides-env-production" rel="noopener noreferrer"&gt;why .env.local overrides .env.production in Next.js&lt;/a&gt; covers which env files belong in Git and which don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  src refspec main does not match any
&lt;/h2&gt;

&lt;p&gt;This one never reaches the server. Git can't find a local branch with the name you asked to push:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to &lt;span class="s1"&gt;'github.com:you/app.git'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I got it in two ways. First, by pushing from a new repository before making a commit, because a branch doesn't exist until it has a commit. Second, by typing &lt;code&gt;git push origin master&lt;/code&gt; in a repository whose branch is called &lt;code&gt;main&lt;/code&gt;. The reverse is just as common: Git 2.x still names the first branch &lt;code&gt;master&lt;/code&gt; unless &lt;code&gt;init.defaultBranch&lt;/code&gt; is set, and then GitHub's suggested &lt;code&gt;git push -u origin main&lt;/code&gt; fails.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch --show-current     &lt;span class="c"&gt;# which branch do you actually have?&lt;/span&gt;
git log --oneline -1          &lt;span class="c"&gt;# is there a commit at all?&lt;/span&gt;

git add . &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit -m &lt;span class="s2"&gt;"First commit"&lt;/span&gt;   &lt;span class="c"&gt;# no commit yet&lt;/span&gt;
git branch -M main                          &lt;span class="c"&gt;# local branch is called master&lt;/span&gt;
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A close relative is &lt;code&gt;fatal: 'upstream' does not appear to be a git repository&lt;/code&gt;. It means the remote name is wrong, not the branch. &lt;code&gt;git remote -v&lt;/code&gt; lists the names you actually have, usually just &lt;code&gt;origin&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick way to read any push error
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Ignore "failed to push some refs". It is the same line for every cause.&lt;/li&gt;
&lt;li&gt;Find the line with &lt;code&gt;!&lt;/code&gt; and read the label in brackets.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[rejected]&lt;/code&gt; means your Git refused: integrate the remote changes, or force-with-lease on your own branch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[remote rejected]&lt;/code&gt; means the server refused: read the &lt;code&gt;remote:&lt;/code&gt; lines.&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;!&lt;/code&gt; line, only "src refspec": the problem is the branch name or a missing commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I deploy this site by building a package and uploading it by hand, so there is no CI between a push and production here. If your host deploys on every push and you then see stale pages, that is a cache problem, not a Git one. See &lt;a href="https://knowledgemarkg.com/blog/chunkloaderror-nextjs-after-deploy-cdn-cached-html" rel="noopener noreferrer"&gt;ChunkLoadError after a Next.js deploy&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does 'error: failed to push some refs to' mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The remote didn't accept at least one branch or tag you tried to push. The line itself is generic. The real reason is the label in brackets on the line above, such as (fetch first), (non-fast-forward), (stale info), (already exists) or [remote rejected], or an earlier 'src refspec ... does not match any' error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I fix 'Updates were rejected because the remote contains work that you do not have locally'?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Someone pushed commits you don't have yet. Run git pull --rebase origin main (or a normal git pull to merge), fix any conflicts, then push again. Don't use git push --force, because it deletes the other commits from the remote.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is my push rejected as non-fast-forward after a rebase?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A rebase or amend replaces commits that are already on the remote, so your branch no longer builds on the remote one. On a branch only you use, push with git push --force-with-lease --force-if-includes. On a shared branch, don't rewrite history. Undo the rebase and add a new commit instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does (stale info) mean in git push?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You used --force-with-lease and the remote branch has moved since your last fetch, so Git refused to overwrite it. Fetch, check what the new commits are, rebase onto them, and then push again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is git push --force-with-lease safe?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Safer than --force, not completely safe. If something fetched in the background, for example your editor, the lease passes even though you never looked at the new commits. In my test this deleted another commit. Adding --force-if-includes (Git 2.30+) blocked the same push.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I fix 'src refspec main does not match any'?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You have no local branch called main. Either the repository has no commit yet (commit first) or the branch has another name, usually master. Check with git branch --show-current, rename with git branch -M main, then push with git push -u origin main.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does GitHub say [remote rejected] when my push looks fine?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitHub received the push and refused it under a rule: a protected branch, a detected secret, a file over 100 MiB, or missing write access. The lines that start with 'remote:' explain which. For secrets and large files, remove them from the commit that added them, not just from a later commit.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/git-push-rejected-failed-to-push-some-refs" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>React Hook useEffect Has a Missing Dependency: Every Fix</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Fri, 20 Nov 2026 05:04:11 +0000</pubDate>
      <link>https://dev.to/kausarraza/react-hook-useeffect-has-a-missing-dependency-every-fix-1lmg</link>
      <guid>https://dev.to/kausarraza/react-hook-useeffect-has-a-missing-dependency-every-fix-1lmg</guid>
      <description>&lt;p&gt;The warning looks like this, and if you work in React or Next.js you have seen it many times:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;React Hook useEffect has a missing dependency: 'userId'. Either include it or remove the dependency array
  react-hooks/exhaustive-deps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It comes from the &lt;code&gt;react-hooks/exhaustive-deps&lt;/code&gt; ESLint rule. Next.js ships it in &lt;code&gt;eslint-config-next&lt;/code&gt;, and Vite's React template enables it too. The rule compares the values an effect reads with the values in its dependency array. When one is missing, React keeps running the effect with an old copy of that value. That is a bug, even when the page looks fine today.&lt;/p&gt;

&lt;p&gt;The rule tells you what is missing. It doesn't tell you which of the usual fixes is right, and some of the quick fixes cause an infinite loop. To get this post's examples and messages right, I ran the rule (eslint-plugin-react-hooks 7.1.1, React 19.3.1) against ten small components. Every warning quoted below is copied from that run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the rule flags and what it ignores
&lt;/h2&gt;

&lt;p&gt;The rule only asks for values that can change between renders. Some values are known to be stable, so it never asks for them. This is what came back for each case:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F48z1vqjnd893rwam3qz2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F48z1vqjnd893rwam3qz2.webp" alt="Table of ten test components and the exhaustive-deps result for each: props, component functions, Redux dispatch and navigate are flagged; setState, useReducer dispatch, useCallback functions and useEffectEvent are not"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;eslint-plugin-react-hooks 7.1.1 against ten components, 19 Nov 2026.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The two &lt;code&gt;dispatch&lt;/code&gt; results are worth noticing. A &lt;code&gt;dispatch&lt;/code&gt; from &lt;code&gt;useReducer&lt;/code&gt; is not flagged, because React guarantees it never changes. A &lt;code&gt;dispatch&lt;/code&gt; from Redux's &lt;code&gt;useDispatch()&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; flagged. It comes from a custom hook, and the rule can't see inside one. &lt;code&gt;navigate&lt;/code&gt; from React Router is flagged for the same reason. If you search "missing dependency dispatch" or "missing dependency navigate", that is why.&lt;/p&gt;
&lt;h2&gt;
  
  
  Fix 1: add the dependency (most of the time this is the answer)
&lt;/h2&gt;

&lt;p&gt;This is the most common case: a prop or state value is used inside the effect but missing from the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Profile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;userId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;fetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// warning: missing dependency 'userId'&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The empty array means "run once". So when &lt;code&gt;userId&lt;/code&gt; changes, the profile keeps showing the first user's name. Adding &lt;code&gt;userId&lt;/code&gt; fixes the bug. Once the effect can run more than once, also add a cleanup flag, so a slow response for the old user can't overwrite the new one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;ignore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;fetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;ignore&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ignore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// a slower, older request can't overwrite the newer one&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If adding the dependency makes the effect run too often, don't remove it. The effect is reading something it shouldn't depend on, and the fixes below deal with that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 2: move the function inside the effect
&lt;/h2&gt;

&lt;p&gt;The second most common message names a function, not a value. Adding the function just swaps one warning for another:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;fetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// missing dependency: 'load'&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// The 'load' function makes the dependencies of useEffect Hook&lt;/span&gt;
            &lt;span class="c1"&gt;// change on every render.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A function declared in the component is a new object on every render. Listing it makes the effect run on every render. If that function sets state, the effect never stops re-running. That is the infinite loop people get after "fixing" the warning. If only the effect uses the function, move it inside. The real dependency, &lt;code&gt;userId&lt;/code&gt;, then shows up in the array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;fetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Fix 3: useCallback or useMemo when the value is shared
&lt;/h2&gt;

&lt;p&gt;If the function is also used elsewhere, for example by a "Refresh" button, wrap it in &lt;code&gt;useCallback&lt;/code&gt;. It then only changes when its own inputs change, and the rule is satisfied:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;load&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useCallback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;fetchUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// no warning: load only changes when userId does&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An object or array built during render has the same problem, and the warning says so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// The 'options' object makes the dependencies of useEffect Hook change on every render.&lt;/span&gt;

&lt;span class="c1"&gt;// Fix: depend on the primitives, build the object inside&lt;/span&gt;
&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on the primitive values (&lt;code&gt;id&lt;/code&gt;) is usually cleaner than wrapping the object in &lt;code&gt;useMemo&lt;/code&gt;. Keep &lt;code&gt;useMemo&lt;/code&gt; for a value that is expensive to compute or used in several places. That is the practical answer to "useCallback vs useMemo": &lt;code&gt;useCallback&lt;/code&gt; keeps a function's identity, &lt;code&gt;useMemo&lt;/code&gt; keeps a computed value's.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 4: useEffectEvent for values you read but don't react to
&lt;/h2&gt;

&lt;p&gt;Sometimes an effect needs the latest value of something, but that value changing is not a reason to re-run it. A timer that logs the current count, or a chat connection that reports the current theme, are typical examples. Listing the value would restart the timer or reconnect on every change.&lt;/p&gt;

&lt;p&gt;React 19.2 added &lt;code&gt;useEffectEvent&lt;/code&gt; for exactly this. Put the code that reads those values in an Effect Event and call it from the effect. It always sees the latest values, and the rule doesn't ask you to list it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;useEffectEvent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Ticker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;roomId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// reads the latest roomId and count, but is not a reason to restart the timer&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;onTick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useEffectEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;roomId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;onTick&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// no warning&lt;/span&gt;

  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Listing it anyway is a mistake the rule catches, with its own message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;onTick&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Functions returned from `useEffectEvent` must not be included in the dependency array.&lt;/span&gt;
&lt;span class="c1"&gt;// Remove `onTick` from the list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Effect Events are only for code called from inside effects. Don't use them to hide a value the effect really depends on. In the example above, if a new &lt;code&gt;roomId&lt;/code&gt; should start a new connection, &lt;code&gt;roomId&lt;/code&gt; belongs in the array.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 5: dispatch and navigate: just list them
&lt;/h2&gt;

&lt;p&gt;For the two custom-hook values in the table, the fix is simply to add them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;dispatch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useDispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// Redux: flagged&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;localDispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useReducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// not flagged&lt;/span&gt;

&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"init"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;localDispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"init"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// add dispatch; localDispatch never needs listing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Redux documents that &lt;code&gt;dispatch&lt;/code&gt; stays the same as long as the store does, so listing it never causes an extra run. Listing &lt;code&gt;navigate&lt;/code&gt; is also correct. If its identity ever changes, the effect runs again, which is harmless for a redirect guard like "send logged-out users to /login". Disabling the rule to avoid typing one word leaves a warning comment in your code for no benefit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why eslint-disable is the wrong fix (and stopped working)
&lt;/h2&gt;

&lt;p&gt;The old shortcut was a comment that switches off the rule for one line. With the plugin's current recommended preset, that comment hides one warning and leaves the bigger problem in place. In my test, an effect that only set state from a prop had its &lt;code&gt;exhaustive-deps&lt;/code&gt; warning disabled, and the build still reported this &lt;strong&gt;error&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// eslint-disable-line react-hooks/exhaustive-deps&lt;/span&gt;

&lt;span class="c1"&gt;// still reported with the recommended preset:&lt;/span&gt;
&lt;span class="c1"&gt;// error  Error: Calling setState synchronously within an effect can trigger cascading renders&lt;/span&gt;
&lt;span class="c1"&gt;//   react-hooks/set-state-in-effect&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That rule is pointing at the real fix. A value calculated from props during render doesn't belong in an effect at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// no effect, no dependency array, no warning&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React's own guide on this, &lt;a href="https://react.dev/learn/you-might-not-need-an-effect" rel="noopener noreferrer"&gt;You Might Not Need an Effect&lt;/a&gt;, covers the other cases: data you can calculate, state that resets when a prop changes, and work that belongs in an event handler. Most "missing dependency" warnings in real projects disappear once the effect is gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I found in this site's own code
&lt;/h2&gt;

&lt;p&gt;It seemed fair to check my own projects too. This site runs on Next.js 16, whose ESLint config ships the same plugin version I tested. Its source has five &lt;code&gt;eslint-disable&lt;/code&gt; comments for &lt;code&gt;exhaustive-deps&lt;/code&gt; and three for &lt;code&gt;set-state-in-effect&lt;/code&gt;, all in admin screens and data hooks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Four sit on &lt;code&gt;useCallback&lt;/code&gt; loaders that read a whole &lt;code&gt;props&lt;/code&gt; object but list only three of its fields. That is the "missing dependency: 'props'" case. The fix is to destructure the fields and list them.&lt;/li&gt;
&lt;li&gt;One is a rich-text editor effect that leaves the editor instance out on purpose, so typing doesn't reset the cursor. That is the job &lt;code&gt;useEffectEvent&lt;/code&gt; was made for.&lt;/li&gt;
&lt;li&gt;Of the three &lt;code&gt;set-state-in-effect&lt;/code&gt; ones, one sets state after an &lt;code&gt;await&lt;/code&gt;, which isn't the synchronous cascade the rule guards against. The other two read something that only exists in the browser after mount: headings in injected article HTML, and &lt;code&gt;navigator.platform&lt;/code&gt;. Each comment says why.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of them is a live bug today, but each one is a place where the next change could quietly read a stale value. They are on the list. When a React build behaves differently in production than locally, it is often a different problem: stale cached HTML pointing at old chunks, covered in &lt;a href="https://knowledgemarkg.com/blog/chunkloaderror-nextjs-after-deploy-cdn-cached-html" rel="noopener noreferrer"&gt;ChunkLoadError after a Next.js deploy&lt;/a&gt;, or a page served from the cache, covered in &lt;a href="https://knowledgemarkg.com/blog/nextjs-page-not-updating-x-nextjs-cache" rel="noopener noreferrer"&gt;Next.js page not updating&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick decision list
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The missing value should re-run the effect&lt;/strong&gt; (a prop, an id, a query): add it, and add a cleanup if the effect fetches.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The missing value is a function only the effect uses&lt;/strong&gt;: move the function inside the effect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The function or object is shared&lt;/strong&gt;: &lt;code&gt;useCallback&lt;/code&gt; for functions; depend on primitives, or &lt;code&gt;useMemo&lt;/code&gt;, for objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The effect needs the latest value but shouldn't re-run when it changes&lt;/strong&gt;: &lt;code&gt;useEffectEvent&lt;/code&gt; (React 19.2+).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dispatch or navigate&lt;/strong&gt;: list them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The effect only calculates state from props&lt;/strong&gt;: delete the effect and calculate during render.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What does 'React Hook useEffect has a missing dependency' mean?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The react-hooks/exhaustive-deps ESLint rule found a value the effect reads, such as a prop, state, or a function declared in the component, that isn't in its dependency array. The effect then keeps the value from the render it was created in and doesn't re-run when it changes, which causes stale-data bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it OK to ignore the missing dependency warning?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rarely. Leaving a value out means the effect can read an old copy of it. If the effect really shouldn't re-run when that value changes, use useEffectEvent (React 19.2 and later) for the code that reads it. Disabling the rule hides the warning, and with the plugin's recommended preset other rules such as set-state-in-effect still report the underlying problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does adding the dependency cause an infinite loop?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually the dependency is a function or object created during render, so it is new on every render. The effect runs, sets state, the component re-renders, the value is new again, and the effect runs again. Move the function or object inside the effect, depend on primitive values, or wrap it in useCallback or useMemo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need to add dispatch to the useEffect dependency array?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For dispatch from useReducer, no: React guarantees it is stable and the rule doesn't flag it. For dispatch from Redux's useDispatch, the rule does flag it because it comes from a custom hook. Add it; Redux keeps it stable while the store is the same, so it causes no extra runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should navigate be in the useEffect dependency array?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. navigate from React Router comes from a custom hook, so the rule asks for it, and listing it is correct. If its identity changes, the effect runs again, which is harmless for a redirect such as sending logged-out users to the login page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is useEffectEvent?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;useEffectEvent is a React hook, stable since React 19.2, that wraps code an effect calls but whose values shouldn't trigger a re-run. The wrapped function always sees the latest props and state. It must not be listed in the dependency array; the exhaustive-deps rule reports an error-style warning if it is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useCallback vs useMemo: which fixes the warning?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;useCallback keeps a function's identity between renders, so use it when an effect depends on a function that is also used elsewhere. useMemo keeps a computed value, such as an object or array. For objects, depending on the primitive values inside the effect is often simpler than either.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/react-hook-useeffect-has-a-missing-dependency" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Does llms.txt Work? Google, Lighthouse and 53 Sites Checked</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Thu, 19 Nov 2026 07:03:50 +0000</pubDate>
      <link>https://dev.to/kausarraza/does-llmstxt-work-google-lighthouse-and-53-sites-checked-5c2g</link>
      <guid>https://dev.to/kausarraza/does-llmstxt-work-google-lighthouse-and-53-sites-checked-5c2g</guid>
      <description>&lt;p&gt;llms.txt is a Markdown file at the root of a site that tells AI tools what the site is and which pages matter. The pitch is simple: hand language models a clean map instead of making them parse your menus and cookie banners. Plenty of plugins and agencies now sell it as AI SEO. The search box tells the other half of the story: "does llms.txt work", "is llms.txt actually used", "is llms.txt worth it".&lt;/p&gt;

&lt;p&gt;I went to the sources instead of the opinions. I read Google's current guidance, then the source code of the Lighthouse audit that now checks the file. I requested &lt;code&gt;/llms.txt&lt;/code&gt; from 53 well-known sites on 19 November 2026 to see who actually publishes one. This site has had one since September, so I can show how it's built too.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;For Google Search, no.&lt;/strong&gt; Google's own guide says Google Search "ignores" llms.txt files. Adding one neither helps nor hurts rankings, AI Overviews or AI Mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chrome's Lighthouse does check it&lt;/strong&gt;, in the new Agentic Browsing category. It checks the format, not whether anything reads the file. A missing file is "not applicable". A broken one fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adoption is real but narrow.&lt;/strong&gt; 25 of the 53 sites I checked have a valid file. Most are developer platforms. OpenAI, Anthropic, Perplexity and Google don't have one on their main domains.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No AI company says its crawler uses it.&lt;/strong&gt; I found no statement from OpenAI, Anthropic or Perplexity that their crawlers read llms.txt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Worth it?&lt;/strong&gt; For documentation and developer products, yes: it's cheap, and coding tools and people pasting your docs into an assistant can use it. For a typical business site, add it only if it's generated automatically, and never ship a broken one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What llms.txt is
&lt;/h2&gt;

&lt;p&gt;Jeremy Howard proposed the format on 3 September 2024 at &lt;a href="https://llmstxt.org/" rel="noopener noreferrer"&gt;llmstxt.org&lt;/a&gt;. It's plain Markdown with a fixed order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An &lt;strong&gt;H1&lt;/strong&gt; with the site or project name. This is the only required part.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;blockquote&lt;/strong&gt; summary in one or two sentences.&lt;/li&gt;
&lt;li&gt;Optional paragraphs or lists with more detail (no other headings).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;H2 sections&lt;/strong&gt; that list links as &lt;code&gt;[name](url): notes&lt;/code&gt;. A section called &lt;strong&gt;Optional&lt;/strong&gt; marks links a tool can skip when it is short on context.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# Example Studio
&lt;/span&gt;
&lt;span class="ge"&gt;&amp;gt; Web design studio in Leeds building fast WordPress and Next.js sites for
&amp;gt; independent shops. Projects start at four weeks.
&lt;/span&gt;
We work with UK retailers only.

&lt;span class="gu"&gt;## Services
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;[Services](https://example.com/services): what we build and how a project runs
&lt;span class="k"&gt;- &lt;/span&gt;[Case studies](https://example.com/work): six shop rebuilds with before/after numbers
&lt;span class="k"&gt;- &lt;/span&gt;[Contact](https://example.com/contact): email and booking form

&lt;span class="gu"&gt;## Guides
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;[Shopify vs WooCommerce](https://example.com/blog/shopify-vs-woocommerce): cost and lock-in compared

&lt;span class="gu"&gt;## Optional
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;[About](https://example.com/about): team and history
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The proposal also suggests Markdown copies of your pages at the same URL plus &lt;code&gt;.md&lt;/code&gt;. It allows the file on a subpath, such as &lt;code&gt;/docs/llms.txt&lt;/code&gt;, which applies to everything under that path. Some sites also publish an &lt;strong&gt;llms-full.txt&lt;/strong&gt;, with the full text of the docs in one file. That one isn't in the spec, and 8 of my 53 sites had it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;llms.txt vs robots.txt:&lt;/strong&gt; robots.txt tells crawlers what they may fetch, and the major crawlers say they obey it. llms.txt only describes your content. It grants and blocks nothing. To control AI crawlers, you still need robots.txt or your CDN. I covered that in &lt;a href="https://knowledgemarkg.com/blog/cloudflare-block-ai-bots-which-to-allow" rel="noopener noreferrer"&gt;which AI bots to block on Cloudflare&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Google says about llms.txt
&lt;/h2&gt;

&lt;p&gt;Google published its guide to generative AI features in Search in May 2026 and clarified it in June. The current text is direct:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You don't need to create new machine readable files, AI text files, markup, or Markdown to appear in Google Search (including its generative AI capabilities), as Google Search itself doesn't use them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It then says keeping an llms.txt for other services is "completely fine", and that it "will neither harm nor help your site's visibility or rankings in Google Search, as Google Search ignores them". The same guide lists "creating unnecessary AI text files (like llms.txt)" among the "AEO/GEO hacks" you can ignore for Google Search.&lt;/p&gt;

&lt;p&gt;So anyone selling llms.txt as a way into Google's AI Overviews is selling something Google has ruled out in writing. What helps there is ordinary SEO: crawlable pages, clear answers and content nobody else has. See &lt;a href="https://knowledgemarkg.com/blog/get-cited-by-chatgpt-ai-overviews" rel="noopener noreferrer"&gt;how to get cited by ChatGPT and AI Overviews&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lighthouse checks it anyway: here's exactly how
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fonjlbyn46jcdsqkgnx8g.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fonjlbyn46jcdsqkgnx8g.webp" alt="Table of Lighthouse llms.txt audit results: 4xx is not applicable, 5xx or 429 fails, an HTML page fails, no H1 line fails, bare URLs fail, under 50 characters fails, an H1 plus a Markdown link passes" width="800" height="577"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The rules, read from the audit's source in lighthouse 13.6.0.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Lighthouse 13.3.0 (May 2026) added an Agentic Browsing category, and one of its audits is called &lt;strong&gt;llms.txt follows recommendations&lt;/strong&gt;. The SEO blogs disagree on what it checks, so I installed &lt;code&gt;lighthouse@13.6.0&lt;/code&gt; and read the audit and its gatherer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It requests &lt;code&gt;/llms.txt&lt;/code&gt; on the &lt;strong&gt;root of the page's origin&lt;/strong&gt;. A valid file on a subpath isn't found.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Any 4xx&lt;/strong&gt; (404, 403, 410) marks the audit &lt;strong&gt;not applicable&lt;/strong&gt;. No file costs you nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5xx or 429&lt;/strong&gt; fails with "Failed with HTTP status".&lt;/li&gt;
&lt;li&gt;For a 200, there are three checks: a line starting with &lt;code&gt;#&lt;/code&gt; and a space (an H1), at least one Markdown link &lt;code&gt;[text](url)&lt;/code&gt;, and at least 50 characters. Miss any of them and it fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the whole check. It doesn't look at the content, the content type or whether the links work. A file with one heading and one link passes, the same as Stripe's 69 KB file.&lt;/p&gt;

&lt;p&gt;The category shows a fraction (audits passed out of audits that apply), not a 0-100 score. I ran it in headless Chrome on three sites: this one passed every applicable audit; Moz, which has no file, scored 0.49 with llms.txt marked N/A; Reddit scored 0.33 with llms.txt failing.&lt;/p&gt;
&lt;h2&gt;
  
  
  I checked 53 sites: who actually has one
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5iyoiwxa41au4b1rfc6x.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5iyoiwxa41au4b1rfc6x.webp" alt="Bar chart of 53 sites checked for llms.txt on 19 November 2026: 25 pass Lighthouse's rules, 2 fail (reddit.com and notion.so), 26 have no file, including openai.com, anthropic.com, perplexity.ai and google.com" width="800" height="530"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;One request per domain on 19 November 2026, scored with Lighthouse's rules. Files on subpaths are not counted.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I requested &lt;code&gt;/llms.txt&lt;/code&gt; from 53 domains (AI companies, developer platforms, website builders, SEO tools, publishers and big tech) and applied Lighthouse's rules to each response. Results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;25 pass.&lt;/strong&gt; Almost all are developer platforms and site builders: Cloudflare, Vercel, Next.js, React, Stripe, GitHub, Supabase, Netlify, Svelte, Shopify, WordPress.org, Wix, Squarespace, HubSpot and Zapier. Anthropic's docs domain redirects to a file of about 100 KB with over 900 links.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;26 have no file&lt;/strong&gt; at the root. That includes openai.com, anthropic.com, perplexity.ai, google.com and developer.chrome.com, the site that documents the Lighthouse audit. Publishers (New York Times, BBC, Guardian, Wikipedia) and Moz and Ahrefs don't have one either.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2 fail.&lt;/strong&gt; Reddit answers &lt;code&gt;/llms.txt&lt;/code&gt; with its normal HTML app and a 200 status. Notion's file starts with a blockquote and has no H1 line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two details stood out. The AI companies publish llms.txt for their &lt;em&gt;documentation&lt;/em&gt; (OpenAI's and Perplexity's developer docs both have one) but not for their main sites. And FastHTML, a project from Answer.AI, the company of the format's author, keeps its file under &lt;code&gt;/docs/&lt;/code&gt;. The spec allows that, but Lighthouse never requests it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Does any AI actually read llms.txt?
&lt;/h2&gt;

&lt;p&gt;As far as public documentation goes, no crawler says it does. OpenAI's, Anthropic's and Perplexity's crawler pages describe robots.txt controls and IP ranges, and none says the crawlers read llms.txt. Google says its search systems ignore the file.&lt;/p&gt;

&lt;p&gt;Where it does get used is on demand. A developer can point a coding assistant at a docs site's llms.txt or llms-full.txt to load the docs in one go. That's why documentation sites dominate the pass list, and why the AI companies publish one for their docs. It's a format for &lt;em&gt;tools that are asked to read it&lt;/em&gt;, not a signal crawlers go looking for.&lt;/p&gt;

&lt;p&gt;I haven't measured whether any AI crawler requests this site's file, because I don't have server logs on this machine. If you have logs, &lt;code&gt;grep "GET /llms.txt"&lt;/code&gt; and look at the user agents. That's the only real answer for your own site.&lt;/p&gt;
&lt;h2&gt;
  
  
  Is llms.txt worth it?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Documentation, APIs, developer tools:&lt;/strong&gt; yes. People feed docs to assistants, and an index plus Markdown pages makes that cleaner. Generate it from your docs source so it stays current.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Business sites and blogs:&lt;/strong&gt; optional. It won't move Google, and no crawler has said it will read it. If your framework can generate it automatically, the cost is close to zero, and a short, accurate description of what you do doesn't hurt. Don't pay anyone to write one for SEO.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Any site with a catch-all route:&lt;/strong&gt; check what &lt;code&gt;/llms.txt&lt;/code&gt; returns today. A single-page app or a CMS that answers every unknown URL with a 200 HTML page fails the Lighthouse audit, like Reddit's. A plain 404 doesn't.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How this site generates its llms.txt (Next.js)
&lt;/h2&gt;

&lt;p&gt;Here the file is a Next.js route handler that builds the Markdown from the same API the pages use, so new posts and tools appear without anyone editing a file. A trimmed version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/llms.txt/route.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;getPosts&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"@/lib/api"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;revalidate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;86400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// rebuild once a day&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getPosts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;pageSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;note&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="sb"&gt;`- [${name}](${url})${note ? `&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;${note}&lt;/span&gt;&lt;span class="sb"&gt;` : ""}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"# Example Studio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"&amp;gt; Web design studio building fast WordPress and Next.js sites."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"## Recent articles"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`https://example.com/blog/${p.slug}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;excerpt&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"text/plain; charset=utf-8"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things matter. The content type is &lt;code&gt;text/plain&lt;/code&gt;, so browsers and tools don't treat it as a page. The links are Markdown links, not bare URLs. And it is regenerated daily rather than written by hand, because a hand-written file goes stale. Ours is about 22 KB and lists the services, every free tool and the 30 most recent articles.&lt;/p&gt;

&lt;p&gt;Whatever you use, check what's live:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Status code and content type&lt;/span&gt;
curl -s -o /dev/null -w &lt;span class="s2"&gt;"%{http_code} %{content_type}\n"&lt;/span&gt; https://example.com/llms.txt

&lt;span class="c"&gt;# First lines: the first one should start with "# "&lt;/span&gt;
curl -s https://example.com/llms.txt &lt;span class="o"&gt;|&lt;/span&gt; head -5

&lt;span class="c"&gt;# Count Markdown links; 0 fails the Lighthouse audit&lt;/span&gt;
curl -s https://example.com/llms.txt &lt;span class="o"&gt;|&lt;/span&gt; grep -c &lt;span class="s2"&gt;"\](http"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A 404 is fine. A 200 with &lt;code&gt;text/html&lt;/code&gt;, no &lt;code&gt;#&lt;/code&gt; line or zero links is the failing case. Then run Lighthouse with the Agentic Browsing category to confirm. If you're tracking whether AI tools send you visitors at all, &lt;a href="https://knowledgemarkg.com/blog/ga4-ai-assistant-channel-measuring-ai-traffic" rel="noopener noreferrer"&gt;set up an AI assistant channel in GA4&lt;/a&gt; first. It answers "is this worth my time" better than any file.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does llms.txt work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not for Google Search: Google's guide says Google Search ignores llms.txt and that it neither helps nor harms rankings. No major AI crawler documents that it reads the file either. It works as an index for tools that are pointed at it, such as coding assistants loading a documentation site, which is why developer platforms are most of the sites that publish one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Google use llms.txt?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google Search does not. Its guide to generative AI features says you don't need machine-readable or AI text files to appear in Google Search, including AI Overviews and AI Mode, because Google Search doesn't use them. Chrome's Lighthouse does check the file's format in its Agentic Browsing category, which is a separate tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does the Lighthouse llms.txt audit check?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lighthouse requests /llms.txt at the root of the page's origin. A 4xx response makes the audit not applicable. A 5xx or 429 fails. A 200 passes only if the file has a line starting with '# ' (an H1), at least one Markdown link in &lt;a href="https://dev.tourl"&gt;text&lt;/a&gt; form, and at least 50 characters. The content itself is not judged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is a missing llms.txt bad for Lighthouse?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. A 404 or any other 4xx marks the llms.txt audit as not applicable, so it doesn't count against the Agentic Browsing category. What fails is a broken file: a 5xx, or a 200 that returns an HTML page, has no H1 line or contains no Markdown links.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between llms.txt and robots.txt?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;robots.txt controls access: it tells crawlers which URLs they may fetch, and major crawlers say they obey it. llms.txt is only a description: a Markdown summary and list of important links. It cannot allow or block anything. To control AI crawlers, use robots.txt or your CDN's bot settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is llms-full.txt?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;llms-full.txt is a common companion file that puts the full text of a site's documentation into one Markdown file, so a tool can load everything in a single request. It is not part of the llmstxt.org proposal. In a check of 53 sites on 19 November 2026, 8 published one, mostly documentation platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should I add llms.txt to my WordPress or business site?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's optional. It won't change Google rankings, and no crawler has said it reads the file. If a plugin or your framework generates it automatically and keeps it current, there's little downside. Don't pay for it as an SEO service, and make sure /llms.txt never returns an HTML page with a 200 status.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/does-llms-txt-work" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>ai</category>
      <category>webdev</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Cloudflare Block AI Bots: What to Block, What to Allow</title>
      <dc:creator>Kausar Raza</dc:creator>
      <pubDate>Wed, 18 Nov 2026 12:00:10 +0000</pubDate>
      <link>https://dev.to/kausarraza/cloudflare-block-ai-bots-what-to-block-what-to-allow-lg4</link>
      <guid>https://dev.to/kausarraza/cloudflare-block-ai-bots-what-to-block-what-to-allow-lg4</guid>
      <description>&lt;p&gt;Cloudflare will happily block AI bots for you. The question is which ones. "AI bot" covers three different jobs: crawlers that collect text to train future models, crawlers that build an AI search index, and fetchers that open one page because a person just asked ChatGPT or Claude about it. Block all three and you're out of the training sets, but you've also vanished from the AI answers that now send real visitors.&lt;/p&gt;

&lt;p&gt;I ran the same request against two sites behind Cloudflare, changing only the bot name, to see what each setting actually does. Below are the results, the current dashboard path (it moved in 2026), and what I'd pick for a business site or a blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Block training bots&lt;/strong&gt; (GPTBot, ClaudeBot, CCBot, Bytespider, Google-Extended) if you don't want your content in future models. They send you no visitors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Allow AI search bots&lt;/strong&gt; (OAI-SearchBot, Claude-SearchBot, PerplexityBot). OpenAI's docs say sites that opt out of OAI-SearchBot "will not be shown in ChatGPT search answers".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Allow user agents&lt;/strong&gt; (ChatGPT-User, Claude-User, Perplexity-User). Block them and "summarise this link" fails for anyone who pastes your URL.&lt;/li&gt;
&lt;li&gt;In Cloudflare that's &lt;strong&gt;Training: Block, Search: Allow, Agent: Allow&lt;/strong&gt;. New domains start with all three on Allow, so nothing is blocked until you change it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Three kinds of AI bots, and why they're not the same
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj8kknveku60zqcbhvgvb.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj8kknveku60zqcbhvgvb.webp" alt="Table of AI crawlers by job: training (GPTBot, ClaudeBot, Google-Extended, CCBot, Bytespider), search index (OAI-SearchBot, Claude-SearchBot, PerplexityBot, Googlebot, Bingbot) and user-requested fetchers (ChatGPT-User, Claude-User, Perplexity-User)" width="800" height="622"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Each company runs separate crawlers for separate jobs. Blocking one does not block the others.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every big AI company now publishes separate user agents, and their documentation spells out what each one is for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI.&lt;/strong&gt; &lt;code&gt;GPTBot&lt;/code&gt; collects training data. &lt;code&gt;OAI-SearchBot&lt;/code&gt; indexes pages for ChatGPT search. &lt;code&gt;ChatGPT-User&lt;/code&gt; fetches a page when a user's request needs it, and because a person started it, OpenAI notes that robots.txt rules "may not apply". Changes to robots.txt take about 24 hours to be picked up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anthropic.&lt;/strong&gt; &lt;code&gt;ClaudeBot&lt;/code&gt; is training, &lt;code&gt;Claude-SearchBot&lt;/code&gt; improves search results, &lt;code&gt;Claude-User&lt;/code&gt; fetches for a person using Claude. Anthropic says its bots respect robots.txt, including &lt;code&gt;Crawl-delay&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Perplexity.&lt;/strong&gt; &lt;code&gt;PerplexityBot&lt;/code&gt; builds its search index and, per Perplexity, isn't used to train foundation models. &lt;code&gt;Perplexity-User&lt;/code&gt; "generally ignores robots.txt rules", because a user asked for the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google.&lt;/strong&gt; &lt;code&gt;Google-Extended&lt;/code&gt; isn't a crawler at all. It's a robots.txt token that tells Google not to use your pages for Gemini training. It "does not impact a site's inclusion in Google Search". Normal Googlebot crawling is unaffected either way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Others.&lt;/strong&gt; &lt;code&gt;CCBot&lt;/code&gt; (Common Crawl, a dataset many models train on), &lt;code&gt;Bytespider&lt;/code&gt; (ByteDance), &lt;code&gt;Amazonbot&lt;/code&gt; and &lt;code&gt;meta-externalagent&lt;/code&gt;. All four are on Cloudflare's own managed robots.txt block list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The practical takeaway: "should I block AI bots?" is really three questions, and most sites answer them differently.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Cloudflare actually returned to each bot
&lt;/h2&gt;

&lt;p&gt;To see the difference, I sent the same request with curl to two sites behind Cloudflare and changed only the User-Agent. Site A is this blog, with no AI blocking. Site B is a company site that has AI training blocked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwiimvwbx0hpyp8ve6lwo.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwiimvwbx0hpyp8ve6lwo.webp" alt="curl test results: on Site A every bot name gets 200; on Site B, GPTBot, ClaudeBot, CCBot and Bytespider get 403 while OAI-SearchBot, Claude-SearchBot, PerplexityBot, ChatGPT-User, Claude-User, Perplexity-User and Googlebot get 200" width="800" height="608"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;18 November 2026. Same request, only the User-Agent changed. Training names are blocked on Site B; search and user agents pass.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On Site B the four training crawlers got a &lt;strong&gt;403&lt;/strong&gt;; everything else, including OAI-SearchBot, ChatGPT-User, Claude-User and Googlebot, got a &lt;strong&gt;200&lt;/strong&gt;. Site B's robots.txt has no AI rules at all, so the block happens at Cloudflare's edge, before the request reaches the server. That's the split you want: the training bots are refused, and the AI search engines can still read and cite the site.&lt;/p&gt;

&lt;p&gt;One caveat that matters if you repeat this. My requests came from an ordinary connection, not from OpenAI's or Anthropic's IP ranges. Cloudflare identifies &lt;em&gt;verified&lt;/em&gt; bots by where they come from, and its policies cover "Verified bots with that behavior and matching unverified bots". So a spoofed name tells you what the rule does with that name. It doesn't prove how the real crawler is treated. For that, look at the real traffic (next sections). You can run the same test on your own site:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# One bot name&lt;/span&gt;
curl -s -o /dev/null -w &lt;span class="s2"&gt;"%{http_code}\n"&lt;/span&gt; \
  -A &lt;span class="s2"&gt;"Mozilla/5.0 (compatible; GPTBot/1.1; +https://openai.com/gptbot)"&lt;/span&gt; \
  https://example.com/

&lt;span class="c"&gt;# Several at once&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; ua &lt;span class="k"&gt;in&lt;/span&gt; GPTBot ClaudeBot CCBot Bytespider OAI-SearchBot ChatGPT-User \
          Claude-SearchBot Claude-User PerplexityBot Perplexity-User Googlebot&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s2"&gt;"%-18s "&lt;/span&gt; &lt;span class="s2"&gt;"$ua"&lt;/span&gt;
  curl -s -o /dev/null -w &lt;span class="s2"&gt;"%{http_code}\n"&lt;/span&gt; -A &lt;span class="s2"&gt;"Mozilla/5.0 (compatible; $ua)"&lt;/span&gt; https://example.com/
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Where the setting is now: AI Crawler and Agent access policies
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F22pl1e1ywyyshx4ze7de.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F22pl1e1ywyyshx4ze7de.webp" alt="Cloudflare dashboard path Security, Settings, filter Bot traffic, AI Crawler and Agent access policies, with three columns: Training (suggested Block), Search (suggested Allow) and Agent (suggested Allow)" width="800" height="541"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The three policies and a sensible starting point for a site that wants to be cited by AI search.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Older guides tell you to flip a single &lt;strong&gt;Block AI bots&lt;/strong&gt; switch. That switch has been replaced. In the dashboard today, pick the domain and go to &lt;strong&gt;Security › Settings&lt;/strong&gt;, filter by &lt;strong&gt;Bot traffic&lt;/strong&gt;, and open &lt;strong&gt;AI Crawler and Agent access policies&lt;/strong&gt;. You set one action per behaviour:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Training.&lt;/strong&gt; Allow, Block, Block on pages with ads, or Disallow (which only adds rules to your robots.txt and relies on the bot obeying them). Cloudflare puts mixed-purpose crawlers that do both training and search in this group, so blocking Training can hit them too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search.&lt;/strong&gt; Allow, Block, or Block on pages with ads. Blocking here removes you from AI search answers, not just from scrapers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent.&lt;/strong&gt; Same options. Cloudflare itself recommends leaving personal agents allowed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;"Block on pages with ads" is for sites that earn from display ads and don't want AI tools reading those pages without showing the ads. For a business site with no ads it behaves like Allow.&lt;/p&gt;

&lt;p&gt;If you remember Cloudflare announcing that it blocks AI crawlers by default: that applied to the earlier rollout. The current docs say new domains start with Search, Agent and Training all on "Allow (do not block)". Don't assume you're protected. Check the setting, or run the curl test above.&lt;/p&gt;
&lt;h2&gt;
  
  
  Managed robots.txt and Content Signals
&lt;/h2&gt;

&lt;p&gt;Blocking at the edge and robots.txt are two separate layers. Cloudflare can also manage robots.txt for you (all plans). With it on, Cloudflare puts its own block in front of your file: a &lt;code&gt;Content-signal&lt;/code&gt; line saying search is fine and AI training isn't (&lt;code&gt;search=yes, ai-train=no&lt;/code&gt;), followed by &lt;code&gt;Disallow&lt;/code&gt; rules for Amazonbot, Applebot-Extended, Bytespider, CCBot, ClaudeBot, Google-Extended, GPTBot and meta-externalagent.&lt;/p&gt;

&lt;p&gt;Content Signals are a newer, voluntary format with three values: &lt;code&gt;search&lt;/code&gt;, &lt;code&gt;ai-input&lt;/code&gt; (using your page to answer a question live) and &lt;code&gt;ai-train&lt;/code&gt;. Nothing forces a crawler to honour them, the same as the rest of robots.txt, which is why the edge block exists. If you'd rather write robots.txt by hand, this is the equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Block AI training, keep search and user-requested fetches
User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: Bytespider
Disallow: /

# Everyone else, including OAI-SearchBot, Claude-SearchBot and PerplexityBot
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check it with a &lt;a href="https://knowledgemarkg.com/tools/robots-txt-validator" rel="noopener noreferrer"&gt;robots.txt validator&lt;/a&gt; before you deploy: a stray &lt;code&gt;Disallow: /&lt;/code&gt; under &lt;code&gt;User-agent: *&lt;/code&gt; blocks Googlebot as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Per-bot control with AI Crawl Control
&lt;/h2&gt;

&lt;p&gt;If the three groups are too coarse, &lt;strong&gt;AI Crawl Control&lt;/strong&gt; (it used to be called AI Audit) lists each crawler that visited your site, with its request count and how often it ignored robots.txt. Each row has an action: &lt;strong&gt;Allow&lt;/strong&gt;, &lt;strong&gt;Block&lt;/strong&gt;, or &lt;strong&gt;Charge&lt;/strong&gt; (pay per crawl, still a closed beta). Block creates a WAF custom rule for you. It's available on every plan, with two limits on Free: detection is by User-Agent only, and you can't customise the block response.&lt;/p&gt;

&lt;p&gt;This is the screen to use for the verified-bot question above. Look at what really arrives, not what a spoofed curl request shows. It's also where you'd allow one mixed-purpose crawler that the Training policy caught.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why can't ChatGPT or Claude read my website?
&lt;/h2&gt;

&lt;p&gt;This is the other half of the search traffic: owners who never meant to block anything and find that ChatGPT says it can't open their page. Work through it in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The AI policies.&lt;/strong&gt; Search or Agent set to Block refuses OAI-SearchBot, ChatGPT-User, Claude-User and the rest. Set them to Allow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bot Fight Mode or a WAF rule.&lt;/strong&gt; A custom rule matching "bot" in the User-Agent, a country block or a strict rate limit catches AI fetchers too. Check &lt;strong&gt;Security › Events&lt;/strong&gt; for the user agent and the rule that fired.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A JavaScript challenge.&lt;/strong&gt; "Under Attack" mode or a managed challenge stops fetchers that don't run JavaScript. The page loads fine in your browser, because you passed the challenge long ago.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;robots.txt.&lt;/strong&gt; A &lt;code&gt;Disallow&lt;/code&gt; for OAI-SearchBot or Claude-SearchBot, or a blanket one under &lt;code&gt;*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content that only exists after JavaScript runs.&lt;/strong&gt; If the HTML your server sends is an empty shell, a crawler that doesn't render scripts sees nothing to quote. Check with &lt;code&gt;curl&lt;/code&gt;: if the text you care about isn't in the response, the bot can't see it either.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run the curl loop from earlier with your own domain. A 403 or a challenge page for OAI-SearchBot or ChatGPT-User is the answer. A 200 with your content in it means the block is somewhere else, or the AI tool simply hasn't crawled you yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd choose, by site type
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Freelancer, agency or local business site.&lt;/strong&gt; Block Training, allow Search and Agent. You want to be the business ChatGPT names when someone asks for a recommendation. Getting cited depends on more than access; &lt;a href="https://knowledgemarkg.com/blog/get-cited-by-chatgpt-ai-overviews" rel="noopener noreferrer"&gt;how to get cited by ChatGPT and AI Overviews&lt;/a&gt; covers the rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blog or content site.&lt;/strong&gt; The same, and measure it. AI referrals show up in GA4 if you set up the channel: see &lt;a href="https://knowledgemarkg.com/blog/ga4-ai-assistant-channel-measuring-ai-traffic" rel="noopener noreferrer"&gt;measuring AI traffic in GA4&lt;/a&gt;. If AI search sends you nothing after a few months, you've lost nothing by allowing it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paywalled, licensed or ad-funded content.&lt;/strong&gt; Consider "Block on pages with ads", or block Search as well. You give up AI citations in exchange for keeping the content to your own pages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation or support sites.&lt;/strong&gt; Allow everything except perhaps Training. You want people's AI assistants to give correct answers about your product.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whatever you choose, it's a setting, not a one-off decision. Look at AI Crawl Control after a month and adjust. If Cloudflare also caches your HTML, &lt;a href="https://knowledgemarkg.com/blog/cf-cache-status-dynamic-cloudflare-not-caching-html" rel="noopener noreferrer"&gt;why cf-cache-status says DYNAMIC&lt;/a&gt; and &lt;a href="https://knowledgemarkg.com/blog/does-cloudflare-cache-404" rel="noopener noreferrer"&gt;does Cloudflare cache 404 responses&lt;/a&gt; cover the caching side of the same dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Should I block AI bots on Cloudflare?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Block AI training crawlers if you don't want your content used to train future models, but allow AI search crawlers and user-requested fetchers if you want to appear in ChatGPT, Claude and Perplexity answers. In Cloudflare's AI Crawler and Agent access policies that means Training: Block, Search: Allow, Agent: Allow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between GPTBot and OAI-SearchBot?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GPTBot collects content that may be used to train OpenAI's models. OAI-SearchBot indexes pages for ChatGPT search. They are controlled separately: blocking GPTBot keeps you out of training, while blocking OAI-SearchBot removes your site from ChatGPT search answers. ChatGPT-User is a third agent that fetches a page when a user asks for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does blocking AI bots hurt my Google rankings?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Blocking Google-Extended, GPTBot or ClaudeBot does not affect normal Google Search; Google states that Google-Extended is not a ranking signal and does not change inclusion in Search. Only blocking Googlebot would. Check that a robots.txt rule meant for AI bots does not sit under User-agent: *.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Cloudflare block AI bots by default?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not on new domains, according to Cloudflare's current docs: Search, Agent and Training all start on Allow (do not block). Check Security, Settings, filter Bot traffic, AI Crawler and Agent access policies, or send a test request with curl using an AI bot's User-Agent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why can't ChatGPT access my website?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Common causes are Cloudflare's Search or Agent policy set to Block, Bot Fight Mode or a WAF rule catching the fetcher, a JavaScript challenge, a robots.txt Disallow for OAI-SearchBot, or content that only appears after JavaScript runs. Security Events in Cloudflare shows which rule refused the request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is Cloudflare AI Crawl Control free?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes, AI Crawl Control is available on all Cloudflare plans. It lists crawlers with their request counts and lets you allow or block each one. On the Free plan detection is by User-Agent only and the block response cannot be customised; pay per crawl is a closed beta.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do AI bots respect robots.txt?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The major training and search crawlers say they do: OpenAI, Anthropic and Perplexity all document robots.txt support for GPTBot, ClaudeBot, OAI-SearchBot, Claude-SearchBot and PerplexityBot. User-initiated fetchers are different: OpenAI says robots.txt may not apply to ChatGPT-User and Perplexity says Perplexity-User generally ignores it. To enforce a block, use Cloudflare's edge policies.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://knowledgemarkg.com/blog/cloudflare-block-ai-bots-which-to-allow" rel="noopener noreferrer"&gt;knowledgemarkg.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>ai</category>
      <category>seo</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
