mrfr
mrfr

Reputation: 1794

Metro Bundler failed to start. (code: EACCES)

I am running ubuntu 18.04

I get this when trying to start my expo server with exp start (I have also tried exp start -c, exp start -c --tunnel, exp start --tunnel).

I get:

felix:~/job/App (dev) $ exp start
[11:50:59] Using project at /home/felix/job/App
[11:51:08] Scanning folders for symlinks in /home/felix/job/App/node_modules (8ms)
[11:51:08] Starting Metro Bundler on port 19001.
[11:51:08] Metro Bundler ready.
[11:51:08] Successfully ran `adb reverse`. Localhost urls should work on the connected Android device.
[11:51:10] Tunnel ready.
[11:51:10] Expo is ready.

[11:51:10] Your URL is: exp432e0186c47243658eeef37602b6c1c4://10.114.17.163:19000
[11:51:10] Logs for your project will appear below. Press Ctrl+C to exit.
[11:51:15] Metro Bundler failed to start. (code: EACCES)

I have tried reinstalling expo, node modules, metro. I have removed my .expo file so that it could be regenerated.

I have (I think) the right permissions on all my files. I do own the repo in my home directory, i dont know if expo creates any files in my root directories.

Mabye there is a way to check exactly where metro bundler failed and threw the error?

Worth noticing is if I create a new app with create-react-native-app and start the server with exp start then it works!! So there semeems to be something wrong with my this repo? Other people with the same operating system can get this to work by simply cloning the repo and starting it with exp start.

Upvotes: 2

Views: 5583

Answers (4)

mimz
mimz

Reputation: 1

you can run:

sudo expo start --tunnel 

Upvotes: 0

Llama D'Attore
Llama D'Attore

Reputation: 437

sudo exp start has fixed this for me in the past. EACCES usually has to do with a permissions based error

Upvotes: 1

Vine
Vine

Reputation: 46

you could equally run command prompt as administrator and execute

net stop http

and then execute

net start http

to restart all ports to make sure its not a connectivity problem

Upvotes: 0

mrfr
mrfr

Reputation: 1794

I solved it. The problem was that metro bundler (the program that builds your js files) could not connect to my android emulator. This was due to that the emulator was created by a root user, so therefor metro bundler did not have the correct permissions so therefor it threw a EACCES error.

What I did was to create a new android emulator with my users permission, then it worked.

Upvotes: 0

Related Questions