Create the file reactnative_expo_wsl2_fix.ps1
Create a shortcut named ReactNative Expo WSL2 Fix
The target need to be powershell.exe -ExecutionPolicy Bypass -f "PATH TO THE LOCATION OF reactnative_expo_wsl2_fix.ps1 FILE"
Example: powershell.exe -ExecutionPolicy Bypass -f "C:\Users\elonmusk\OneDrive\Documents\reactnative_expo_wsl2_fix.ps1"
Run the shorcut as administrator, wait and hit enter when finish.
Update your package.json
and insert a new option scripts
section as you see on that package.json
Then run npm run startwsl
.
if the npm run startwsl
does not update your ip address, maybe your interface name is incorrect.
To check the correct interface name, just type on powershell netsh.exe interface ip show address
, get the correct name and update on the package.json -> scripts
section.