Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Print a little message when root/bin aren't going to be seen

  • Loading branch information...
commit f4bd006fd16feb61ef2a9b21d4baab7ef0c8006f 1 parent 2ff760b
@isaacs isaacs authored
Showing with 14 additions and 1 deletion.
  1. +5 −0 lib/bin.js
  2. +9 −1 lib/root.js
View
5 lib/bin.js
@@ -7,5 +7,10 @@ function bin (args, cb) {
var path = require("path")
, global = npm.config.get("global")
, b = global ? path.join(npm.prefix, "bin") : path.join(npm.dir, ".bin")
+ , PATH = (process.env.PATH || "").split(":")
output.write(b, cb)
+ if (npm.config.get("global") && PATH.indexOf(b) === -1) {
+ output.write("(not in PATH env variable)"
+ ,npm.config.get("logfd"))
+ }
}
View
10 lib/root.js
@@ -2,5 +2,13 @@ module.exports = root
var npm = require("../npm")
, output = require("./utils/output")
+ , log = require("./utils/log")
-function root (args, cb) { output.write(npm.dir, cb) }
+function root (args, cb) {
+ output.write(npm.dir, cb)
+ var rp = require.paths.concat(module.paths)
+ if (rp.indexOf(npm.dir) === -1) {
+ output.write("(not in NODE_PATH env variable)"
+ ,npm.config.get("logfd"))
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.