Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
error-handler: improve EISDIR error message
Browse files Browse the repository at this point in the history
Reports of `EISDIR` on the issue tracker are almost exclusively caused by users
trying to install something that does not have a `package.json`. However, it is
clearly difficult for many users to discern this simple problem from the error
code alone. So let's expand upon it.

PR-URL: #9396
  • Loading branch information
kenany authored and zkat committed Aug 27, 2015
1 parent bbb25f3 commit 0313e40
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/utils/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ function errorHandler (er) {
].join("\n"))
break

case "EISDIR":
log.error("eisdir", [er.message
,"This is most likely not a problem with npm itself"
,"and is related to npm not being able to find a package.json in"
,"a package you are trying to install."
].join("\n"))
break

default:
log.error("", er.message || er)
log.error("", ["", "If you need help, you may report this error at:"
Expand Down

0 comments on commit 0313e40

Please sign in to comment.