Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

proper semver, and report folder properly

  • Loading branch information...
commit f8546b4627728a34b163ccb4cd82d216519da8e5 1 parent b04cb44
@isaacs isaacs authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/outdated.js
View
10 lib/outdated.js
@@ -26,7 +26,7 @@ var readInstalled = require("./utils/read-installed")
, asyncMap = require("./utils/async-map")
, npm = require("../npm")
, log = require("./utils/log")
- , semver = require("./utils/semver")
+ , semver = require("semver")
// outdated(pref)
// deps = pref/package.json dependencies, or {<pref/node_modules/*>:"*"}
@@ -44,7 +44,9 @@ var readInstalled = require("./utils/read-installed")
var output
function outdated (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
- outdated_(npm.prefix, args, function (er, list) {
+ var pref = npm.prefix
+ if (npm.config.get("global")) pref = path.resolve(pref, "lib")
+ outdated_(pref, args, function (er, list) {
if (er) return cb(er)
if (list.length && !silent) {
var outList = list.map(function (ww) {
@@ -70,7 +72,9 @@ function outdated_ (prefix, args, cb) {
validateDep(prefix, args, dep, req, function (er, exists, needsUpdate) {
if (er) return cb(er)
log([prefix, dep, req, exists, needsUpdate], "outdated_")
- if (needsUpdate) return cb(null, [[prefix, dep, exists]])
+ if (needsUpdate) return cb(null, [[path.resolve(prefix
+ , "node_modules", dep)
+ , dep, exists]])
else if (!exists) return cb(null, [])
else outdated_(path.resolve(prefix, "node_modules", dep), args, cb)
})
Please sign in to comment.
Something went wrong with that request. Please try again.