Open firewall for Expo node project (windows)

If you are testing your mobile app from a real devicc and need to access your expo app locally, here’s an example of opening the ports for the necessary services. (Windows powershell (admin))

# Allow Node.js inbound
New-NetFirewallRule -DisplayName "Node.js" -Direction Inbound -Program "C:\Program Files\nodejs\node.exe" -Action Allow

# Allow specific Expo port
New-NetFirewallRule -DisplayName "Expo Dev Server" -Direction Inbound -Protocol TCP -LocalPort 8081 -Action Allow

# Allow Metro bundler port range
New-NetFirewallRule -DisplayName "Metro Bundler" -Direction Inbound -Protocol TCP -LocalPort 19000-19006 -Action Allow

Node.js npx SecurityError: (:) [], PSSecurityException

PS C:\dev> npx
npx : File C:\Program Files\nodejs\npx.ps1 cannot be loaded because running scripts is disabled on this syste 
m. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.       
At line:1 char:1
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

If you can’t run the “npx” command on Windows, check your ExecutionPolicy via Windows PowerShell.

PS C:\> Get-ExecutionPolicy
Restricted
PS C:\> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y
PS C:\> Get-ExecutionPolicy
RemoteSigned