Hassan Raza
Hassan Raza

Reputation: 679

bundling failed: Error: ENOENT: no such file or directory, scandir React Native

I have no error in my project. But the build not successfully load. see the below image. for more details for error. I am using the below command to run the build react-native run-android but the npm failed to create the build. this image directory exists and I give the correct path for images. Thanks in advance.

enter image description here

-root --assets ---images ---- All Images here.

../../assets/images/sky-img.jpg use this in code.

Upvotes: 6

Views: 10494

Answers (3)

Orel Hassid
Orel Hassid

Reputation: 380

Make sure you run the command from the root directory and not from android directory.

android> cd..
project> npx react-native run-android --variant=release

Upvotes: 8

WOLF CRECENT
WOLF CRECENT

Reputation: 211

Just closing and re-opening the cmd terminal or whatever you are using to run the metro bundler worked for me.

Upvotes: 12

Sanu Kumar
Sanu Kumar

Reputation: 81

Just reset the cache of your Metro Bundler with:

npm start -- --reset-cache

This is happening because the bundler needs to refresh it's existing bundles and the path you previously set.

Upvotes: 8

Related Questions