NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native)

EISDIR stands for “Error, Is Directory“. This means that NPM is trying to do something to a file but it is a directory. In your case, NPM is trying to “read” a file which is a directory (Line: 4). Since the operation cannot be done the error is thrown.

Three things to make sure here.

  1. Make sure the file exists. If it does not, you need to create it. (If NPM depends on any specific information in the file, you will need to have that information there).
  2. Make sure it is in fact a file and not a directory.
  3. It has the right permissions. You can change the file to have all permissions with “sudo chmod 777 FILE_NAME”. (Careful: You are giving Read, Write and Execute permissions to every one on that file)

Leave a Comment