EISDIR in Node.js — What It Means and How to Fix It
What the Node.js/npm error EISDIR means and how to resolve it.
Published October 26, 2026
EISDIR means an operation expected a file but was given a directory path instead.
Key points
- Commonly caused by accidentally passing a directory path to a function like fs.readFile()