This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Better error message on engine mismatch

  • Loading branch information...
isaacs committed Nov 6, 2011
1 parent 841e212 commit f4f53d2fca95a480f49d7e5691f18032b55248db
Showing with 13 additions and 4 deletions.
  1. +13 −4 lib/cache.js
View
@@ -410,10 +410,19 @@ function addNameRange (name, range, cb) {
}
function installTargetsError (requested, data) {
return new Error("Not found: "+data.name+"@'"+requested+"'\n"
+"Valid install targets:\n"
+JSON.stringify(Object.keys(data["dist-tags"])
.concat(Object.keys(data.versions || {}))))
var targets = Object.keys(data["dist-tags"]).filter(function (f) {
return (data.versions || {}).hasOwnProperty(f)
}).concat(Object.keys(data.versions || {}))
requested = data.name + (requested ? "@'" + requested + "'" : "")
targets = targets.length
? "Valid install targets:\n" + JSON.stringify(targets)
: "No valid targets found.\n"
+ "Perhaps not compatible with your version of node?"
return new Error( "No compatible version found: "
+ requested + "\n" + targets)
}
function addNameVersion (name, ver, cb) {

0 comments on commit f4f53d2

Please sign in to comment.