5

I started a new app using expo but when I try to open the debugger-ui with cmd-d and click on debug remote js I've got this ugly message:

Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (node:fs:720:3)
    at tryReadSync (node:fs:430:20)
    at Object.readFileSync (node:fs:476:19)
    at UnableToResolveError.buildCodeFrameMessage (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:304:17)
    at new UnableToResolveError (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:290:35)
    at ModuleResolver.resolveDependency (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
    at DependencyGraph.resolveDependency (/Users/me/my/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
    at /Users/me/my/node_modules/metro/src/lib/transformHelpers.js:271:42
    at Server.<anonymous> (/Users/me/my/node_modules/metro/src/Server.js:842:41)
    at Generator.next (<anonymous>)

I tried googling but none of the solution works Any idea to fix it?

user3887366
  • 2,226
  • 4
  • 28
  • 41

3 Answers3

4

It's a React-native issue; the error is linked to the metro dependencies inside node_modules.

The EISDIR error is likely to be a misreported error due to a bug in metro that has been fixed in metro 0.65.

Some methods of troubleshooting can be found here.

  • 1
    Looks like this is as close as we're going to get to the answer. Linked thread contains possible ways to debug the error and a few suggestions how to fix it. It seems that error does not affect the functionality and hopefully will be fixed in newer react-native versions. Thanks – AphonopelmaChalcodes Oct 11 '21 at 20:09
2

I uninstalled the Expo Go app from my phone, and then downloaded & installed it again, and it worked.

Albos Hajdari
  • 113
  • 1
  • 12
1

I ran into the same problem while I was changing some npm settings. I did a mistake with one npm config set command and this added a line referring to a non-existing directory to C:\Users\{User}\.npmrc. After I deleted that line manually from .npmrc, the problem was gone.

maximus383
  • 584
  • 8
  • 25
  • I have no file .npmrc at this location and I do not recall doing operations with npm config set. However I've seen some posts from people on other websites which mentioned this solution, so I guess it's worth trying. – AphonopelmaChalcodes Oct 11 '21 at 20:14
  • Please mention that you have copy-pasted this answer from https://stackoverflow.com/a/35429397/1624844 – Amir-Mousavi Feb 09 '22 at 15:19