I installed the react-native-cli
with sudo npm i -g react-native-cli
.
Created a new project with react-native init test
.
Then cd test
and react-native run-android
.
Doing this hangs at info Starting JS server
.
So I googled a bit and tried react-native start
and react-native run-android
in two terminal windows. I got as far as installing the app. But when the app opens, I get this error:
Loading dependency graph, done.
error: bundling failed: Error: EACCES: permission denied, open '/tmp/metro-cache/3a/0ec8029464497f1f8a72a021aebc5e6b40276578a46ddc09a7dc04d623e70940841960'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194:35)
at FileStore._set (/home/$USER/test/node_modules/metro-cache/src/stores/FileStore.js:74:10)
at FileStore.set (/home/$USER/test/node_modules/metro-cache/src/stores/FileStore.js:52:12)
at Cache.set (/home/$USER/test/node_modules/metro-cache/src/Cache.js:124:31)
at /home/$USER/test/node_modules/metro/src/DeltaBundler/Transformer.js:230:13
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/$USER/test/node_modules/metro/src/DeltaBundler/Transformer.js:46:24)
at _next (/home/$USER/test/node_modules/metro/src/DeltaBundler/Transformer.js:66:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)::ffff:127.0.0.1 - - [02/Jan/2020:07:29:33 +0000] "GET /index.bundle?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-""okhttp/3.12.1"
The file /tmp/metro-cache/3a/0ec8029464497f1f8a72a021aebc5e6b40276578a46ddc09a7dc04d623e70940841960
does not exist. I tried creating the file, and giving it 777 permissions, but no changes.
I'm using a physical device, connected via usb.
Someone please help, I spent about 10 hours stuck on this. I use manjaro linux. I have android studio and the sdks installed. Also Java 8 too. I have yarn installed.