Fix some edge cases

cc @sh1mmer @Matt-Esch
this is the case where `JSON.parse()` fails which doesn't have a posix errno code.

i.e. npm installs a thing in node_modules but then is like "PACKAGE.JSON IS THE EMPTY STRING LOL"