Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcli.js11
-rw-r--r--lib/build.js11
2 files changed, 15 insertions, 7 deletions
diff --git a/cli.js b/cli.js
index 5a91e3596..013a3446c 100755
--- a/cli.js
+++ b/cli.js
@@ -1,11 +1,18 @@
#!/usr/bin/env node
;(function () { // wrapper in case we're in module_context mode
-// don't assume that npm is installed in any particular spot, since this
-// might conceivably be a bootstrap attempt.
var log = require("./lib/utils/log")
log.waitForConfig()
log.info("ok", "it worked if it ends with")
+if (__filename.match(/Cellar\/npm\/[^\/]+\/libexec\/cli.js$/)
+ ||process.execPath.match(/Cellar\/node\/[^\/]+\/bin\/node$/) {
+ log.warn("This program is not compatible with Homebrew."
+ +"\n brew rm npm ; brew rm node"
+ +"\nThen use one of the techniques in this gist instead:"
+ +"\nhttps://gist.github.com/579814", "brew incompatible")
+}
+
+
var fs = require("./lib/utils/graceful-fs")
, path = require("path")
, sys = require("./lib/utils/sys")
diff --git a/lib/build.js b/lib/build.js
index 4a7546f5e..1dcfcb0f7 100644
--- a/lib/build.js
+++ b/lib/build.js
@@ -265,11 +265,7 @@ function linkMans (pkg, cb) {
exec("manpath", [], null, false, function (er, code, stdout, stderr) {
var manpath = er ? [] : stdout.trim().split(":")
if (manpath.indexOf(manroot) === -1) {
- log.warn( "It seems " + manroot + " might not be visible to man\n"
- + "For greater justice, please add it to your man path\n"
- + "See: `man man`"
- , pkg._id + " linkMans"
- )
+ log.warn("man pages installing to " + manroot + ", outside MANPATH")
}
asyncMap(man, function (man, cb) {
var parseMan = man.match(/(.*)\.([0-9]+)(\.gz)?$/)
@@ -298,6 +294,11 @@ function linkMans (pkg, cb) {
function linkModules (pkg, target, cb) {
log.silly(pkg.modules, "linkModules")
log.verbose(target, "linkModules")
+ if (target === npm.root
+ && !target.match(/node_modules$/)
+ && -1 === require.paths.indexOf(target)) {
+ log.warn("modules installing to "+target+", outside NODE_PATH")
+ }
var mod = pkg.modules
// FIXME: remove in 0.3.0, and uncomment this functionality in