ds300 / ds300/patch-package

EISDIR: illegal operation on a directory, read

Open
#308 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.2k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

Got `EISDIR: illegal operation on a directory, read` upon `npx patch-package some-package-name`.

When making a patch, patch-package create a folder in `/tmp` with the package.json, and ran my package manager (`yarn`) from that directory.
But yarn will try to traverse all the folders up and search for any `package.json` file. In my case, for some reason, I had a `package.json` file in my root folder, that I was happy to delete and solve the issue above. As far as I know, you can't specify a "root folder" with yarn, to prevent it to search parent directories. If I had `npm` as my default package manager, this would have not failed.

In most cases you may have both. Would it be worth to attempt with `yarn` first, and fallback with `npm` in case of failure? Or maybe just provide a better error message. Right now it's somehow cryptic.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.