I am trying to run my Expo app on an iOS device using the ngrok tunnel since I am currently connected to a public wifi that does not allow my iOS device to access the Expo service on my Macbook.
First I tried the suggested command npx expo start --tunnel
but its giving a error installing @expo/ngrok
even after it has installed it globally.
CommandError: Please install @expo/ngrok@^4.1.0 and try again
% npx expo start --tunnel
Starting project at /Users/foo/expo-project
Starting Metro Bundler
✔ The package @expo/ngrok@^4.1.0 is required to use tunnels, would you like to install it globally? … yes
Installing @expo/ngrok@^4.1.0...
> npm install --global @expo/ngrok@^4.1.0
Installed @expo/ngrok@^4.1.0
CommandError: Please install @expo/ngrok@^4.1.0 and try again
Next I tried installing ngrok using brew
and started it on port 3000
and started npx expo start --tunnel
but it asks again to install @expo/ngrok
and fails the installation with the same error.
Also tried npx expo start
, used the phone to scan the QR code but it still cant connect to the Expo project, likely because its not trying to connect over the ngrok tunnel.
What else can we try?