React Native Debug Error: "ENOENT: File or directory not found"

Issue: I encountered an error while running the remote debugger, as the metro server is unable to locate a specific file.

Error: ENOENT: no such file or directory, open '/home/hery/Workspace/NyTiona/http:/localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.nytiona&modulesOnly=false&runModule=true'
    at Object.openSync (fs.js:498:3)
    at Object.readFileSync (fs.js:394:35)
    at getCodeFrame (/home/hery/Workspace/NyTiona/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/home/hery/Workspace/NyTiona/node_modules/metro/src/Server.js:992:22)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Server._processRequest (/home/hery/Workspace/NyTiona/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/hery/Workspace/NyTiona/http:/localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.nytiona&modulesOnly=false&runModule=true'
}

Note: This error persists regardless of whether I am connecting via USB or Wi-Fi.

Information: My current React Native setup

    System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
    Memory: 1.51 GB / 7.49 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.2 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.13 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 30
      Build Tools: 30.0.2, 30.0.3, 31.0.0
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.2 AI-202.7660.26.42.7486908
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.65.1 => 0.65.1 
  npmGlobalPackages:
    *react-native*: Not Found

Thank you! 😃

Answer â„–1

I encountered a similar issue and resolved it by running the following command:

npm start -- --reset-cache

This simple solution fixed my problem.

Answer â„–2

Thanks to the helpful advice from Shoaib Khan, I was able to successfully resolve the issue by utilizing two separate terminals. In one terminal, I executed the following command:

npx react-native start "--reset-cache"

In the second terminal, I simply brought up android with the command:

npx react-native run-android

Remember to delete the node_modules directory and then reinstall them using npm install.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ionic app on mobile device experiencing issue with Autocomplete feature not filtering correctly in Angular

I am facing an issue with my autocomplete form. It works perfectly fine locally, but once compiled to a PWA, the data filtering feature stops functioning properly. The API is returning a JSON array response as expected. var modify = function (term) ...

Utilizing variables for Protractor command line parameters

I am struggling to make variables work when passing parameters as a string in my code. Conf.ts params: { testEnvironment: TestEnvironment.Prod, }, env.ts export enum TestEnvironment { Dev = 'dev', QA = 'qa', Prod ...

When an undefined value is passed in a WHERE condition, it is interpreted as a true or matching condition in TypeORM

After some testing, I came across an interesting quirk with typeorm. It turns out that if a property in the WHERE clause of a FIND query (such as find, findOne, findBy, etc) is undefined, it behaves as if it's true and returns records - returning the ...

Issue: ASSERTION ERROR: token must be declared [Expecting => null is not undefined <=Actual]

I encountered an error while working on my project. The only special thing I did was use oidc(openId) for authentication. I made some changes to the bootstrap project and now the first component that is running is the home-main component, which includes t ...

Deployment failure due to undetected development keys in gitignore

I have a TypeScript-coded Express server with three files for keys in the compiled and pre-compiled code: /// dev.ts - development keys const keys = { googleClientSecret: "GOOGLE_KEY", mongoURI: "mongodb+srv://MONGO_K ...

Tips for customizing the height of the select component in React Material UI

Currently, I am working on a select component that has a fixed height which cannot be decreased. You can see the screenshot below: https://i.sstatic.net/UtfXd.png The issue I am facing is that I want the height of the Select component to match that of th ...

Utilizing a setup module for configuration purposes

In the process of developing my angular application, I have integrated several external modules to enhance its functionality. One crucial aspect of my final application is the configuration classes that store important values like URLs and message keys us ...

Arranging Angular Cards alphabetically by First Name and Last Name

I am working with a set of 6 cards that contain basic user information such as first name, last name, and email. On the Users Details Page, I need to implement a dropdown menu with two sorting options: one for sorting by first name and another for sorting ...

Is it possible to selectively export certain interfaces within a .d.ts file?

// configuration.d.ts export interface Configuration { MENU_STRUCTURE: Node[]; } interface Node { name: string; } Looking at the snippet above, I am aiming to only export Configuration. However, I noticed that I can also import Node from an ext ...

The resurgence of React JS in its role as a powerful tool

Although I struggle with React JS, I couldn't find a solution for this particular issue. I'm trying to incorporate this function into my tsx file and display it on the screen within a component. function displayUsers() { const UserListComponent ...

Having trouble correctly inputting the HOC function that accepts a custom property key

Here is a demonstration of an HOC function that takes a component and a property key, injecting a value at the specified property key: import * as React from 'react' type WrappedComponentProps<PropertyKey extends string> = { [k in Proper ...

What is the best way to declare only a portion of a JavaScript module?

I'm having trouble understanding declarations. If I only need to declare a portion of a module, is this the correct way to do it (disregarding the use of 'any')? import { Method as JaysonMethod } from 'jayson/promise'; declare cla ...

How to utilize a defined Bootstrap Modal variable within a Vue 3 single file component

I'm diving into the world of TypeScript and Vue 3 JS. I created a single-file-component and now I'm trying to implement a Bootstrap 5 modal. However, my VSCode is showing an error related to the declared variable type. The error message reads: ...

React Native: Issue with Higher Order Component when utilizing the `onLayout` prop

The functionality of this component involves rendering the Placeholder. Once it acquires its layout, this higher-order component (HOC) updates the state and invokes the child component with the values. Everything seems to be working fine up to this point. ...

Creating a JSON object from an array of data using TypeScript

This might not be the most popular question, but I'm asking for educational purposes... Here is my current setup: data = {COLUMN1: "DATA1", COLUMN2: "DATA2", COLUMN3: "DATA3", ..., COLUMNn: "DATAn"}; keyColumns = ["COLUMN2", "COLUMN5", "COLUMN9"]; ...

What is the best way to retrieve a value from async/await functions?

async function fetchNetworkStatus() { const network = await Network.getConnection(); setConnection(network.isConnected); console.log(connectionStatus); if (network.isConnected) { return true; } else { ...

Showing json information in input area using Angular 10

I'm facing an issue with editing a form after pulling data from an API. The values I retrieve are all null, leading to undefined errors. What could be the problem here? Here's what I've tried so far: async ngOnInit(): Promise<void> ...

Looping to run an async process (sequilize.authenticate) multiple times until successful

I need my microservice to wait for the database to become available before proceeding. There is a sidecar Cloud SQL proxy involved that requires some time for the database connection. My current approach involves a for loop that retries connecting after a ...

Disabling ion-select in Ionic 2 with Typescript

To disable an ion-select element in Angular, you can use the disabled attribute like this: <ion-item> <ion-label stacked>Property Type</ion-label> <ion-select [(ngModel)]="propType" (ionChange)="ionChanger()" di ...

Angular functions fail to update the loop variable

Using the documentSnapshot function in Firestore to verify the existence of a document. The function is executed in a loop up to a value of 5. However, even though the function runs 5 times, the value of 'i' always reflects the last value. The ...