summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install.js')
-rw-r--r--deps/npm/lib/install.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index fc1c26aaf0..1aabb46019 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -710,15 +710,21 @@ function checkEngine (target, cb) {
var npmv = npm.version
, force = npm.config.get("force")
, nodev = force ? null : npm.config.get("node-version")
+ , strict = npm.config.get("engine-strict") || target.engineStrict
, eng = target.engines
if (!eng) return cb()
if (nodev && eng.node && !semver.satisfies(nodev, eng.node)
|| eng.npm && !semver.satisfies(npmv, eng.npm)) {
- var er = new Error("Unsupported")
- er.code = "ENOTSUP"
- er.required = eng
- er.pkgid = target._id
- return cb(er)
+ if (strict) {
+ var er = new Error("Unsupported")
+ er.code = "ENOTSUP"
+ er.required = eng
+ er.pkgid = target._id
+ return cb(er)
+ } else {
+ log.warn( "engine", "%s: wanted: %j (current: %j)"
+ , target._id, eng, {node: nodev, npm: npm.version} )
+ }
}
return cb()
}