react native expo debugger-ui Error: EISDIR: illegal operation on a directory, read

Viewed 2176

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?

3 Answers

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.

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

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.

Related