Running Expo in Windows Subsystem for Linux (WSL2)

<p>If it runs in Node.js, it can run Expo. Even better, if it runs in Linux, you can take advantage of all the excellent React Native tools that may not be utilizing cross-platform utilities like&nbsp;<code>cross-env</code>. Since Windows 10 has support for Linux through a virtualized Windows Subsystem for Linux (WSL2), we can use that to run our Expo applications, build tooling, and more.</p> <p>Getting everything working on WSL2&nbsp;<em>does</em>&nbsp;have a few gotchas, which is why this guide can help you get up and running quickly and avoid some of the most common pitfalls (spoiler: it&rsquo;s networking related).</p> <h1>Overview</h1> <ul> <li>Setting up WSL2</li> <li>Configuring&nbsp;<code>WSLHostPatcher</code></li> <li>Alternative: Using Windows Firewall Rules</li> <li>Final considerations</li> </ul> <h1>Setting up WSL2 for Expo Development</h1> <p>WSL2 gives you access to a fully featured Linux command line inside of Windows. While great cross-platform tools like&nbsp;<code>env-cmd</code>&nbsp;exist, not every tool we use in React Native development is Powershell-aware. Using WSL2 eliminates those problems entirely; it&rsquo;s just Linux. Unless specified, all our commands will be in WSL2&rsquo;s Linux environment.</p> <p><a href="https://blog.expo.dev/running-expo-in-windows-subsystem-for-linux-wsl2-425f6fd7838e"><strong>Click Here</strong></a></p>
Tags: running Expo