Solution to the EISDIR connundrum


(Brian Thompson) #1

Every day I see one or two people reporting the same EISDIR error when trying to install a package globally. See this as an example.

The argument for installing global packages is one I’d like to avoid, but it seems like the standard is moving towards using something like a node version manager (nvm) to manage your nvm versions, and then maintaining package dependencies inside each project, and referencing whatever you need to run from those packages with npm scripts or actual code itself. Isn’t this the intended use case?

The node version managers are separate from npm, Inc., so that may be problematic seeing that support may dwindle in the future, but they are open source, so they could be forked and maintained under the npm umbrella if those communities cease to support such technologies.

I think the logging is fine. The EISDIR is self-explanatory in my opinion, but the root cause is not always the same.

Wrapping up, seeing the EISDIR error reporting trend in the “support” tag gave rise to this idea, and I thought it’d be worth sharing with the community.

Let me know your thoughts!

Thanks,
Brian


(Lars Willighagen) #2

I’ve seen two main categories, EISDIR in .staging and EISDIR in _cacache. Correct me if I’m wrong though, there might be different causes for each of those. We probably want canonical topics for both to link to. I suggest the following, since they’re the first topics in #bugs for the respective categories.


Unhandled rejection Error: EISDIR: illegal operation on a directory
opencv4nodejs not installing in MAC OS Mojave 10.14
Unable to install packages on MacOS
(Lars Willighagen) #3

Hmm, I guess they’re both the same after all. Also, thanks @shadowspawn for your work on this!


(Lars Willighagen) #4

I think I’m moving this to #development because it isn’t a feature request (I hope), we have enough #bugs posts already, and this is probably more of an implementation thing anyway. We still have around 2 posts about this per day, and that’s just the people who don’t look/find the dozens of pre-existing posts — imagine the actual number of people encountering this. Again, shout-out to @shadowspawn for handling most, if not all of them.

@zkat, not sure if I should ping you specifically here, but I was wondering if this is being tracked internally already, or if this is left up to community contributors.


(Kat Marchán) #5

I’ve taken a look, and frankly, I have no idea why this is happening. I tried to go into cacache and suss it out, but this error just doesn’t make sense, and it almost makes me wonder if it’s a node bug, but that’d be weird. I’d love some help with it, and I think it’s fine to move this to #development.