check-node-version
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -10,3 +10,3 @@ #!/usr/bin/env node | ||
function logVersionError(err) { | ||
function logVersionError(name, err) { | ||
if (err.stderr) { | ||
@@ -30,4 +30,7 @@ console.error(err.stderr); | ||
} | ||
if (info.notfound) { | ||
console.error(name + ': not installed'); | ||
} | ||
if (info.error) { | ||
logVersionError(info.error); | ||
logVersionError(name, info.error); | ||
} | ||
@@ -34,0 +37,0 @@ }); |
13
index.js
@@ -8,2 +8,3 @@ "use strict"; | ||
var filterObject = require("object-filter"); | ||
var assign = require("object.assign"); | ||
@@ -35,3 +36,8 @@ var PROGRAMS = { | ||
var commandDescription = JSON.stringify(command); | ||
if (execError || stderr) { | ||
if (execError && execError.code === 127) { | ||
return callback(null, { | ||
notfound: true, | ||
}); | ||
} | ||
else if (execError || stderr) { | ||
var runError = new Error("Command failed: " + commandDescription); | ||
@@ -72,3 +78,3 @@ if (stderr) { | ||
function normalizeOptions(options) { | ||
return Object.assign({ | ||
return assign({ | ||
getVersion: defaultGetVersion, | ||
@@ -112,2 +118,5 @@ }, options); | ||
} | ||
if (versions[name].notfound) { | ||
programInfo.notfound = versions[name].notfound; | ||
} | ||
if (wanted[name]) { | ||
@@ -114,0 +123,0 @@ programInfo.wanted = new semver.Range(wanted[name]); |
{ | ||
"name": "check-node-version", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Check installed versions of node and npm", | ||
@@ -30,2 +30,3 @@ "main": "index.js", | ||
"object-filter": "^1.0.2", | ||
"object.assign": "^4.0.4", | ||
"run-parallel": "^1.1.4", | ||
@@ -32,0 +33,0 @@ "semver": "^5.0.3" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13850
351
6
+ Addedobject.assign@^4.0.4
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.6(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.7(transitive)
+ Addedset-function-length@1.2.2(transitive)