From 319488238a8faa9edc57db115118f7adca289107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Boulanouar?= Date: Tue, 14 Mar 2017 11:46:22 +0100 Subject: [PATCH] Fix windows childProcess error (spawn npm ENOENT) --- lib/agent/security/security.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/agent/security/security.js b/lib/agent/security/security.js index aa16d31..ce00aa4 100644 --- a/lib/agent/security/security.js +++ b/lib/agent/security/security.js @@ -112,7 +112,7 @@ Security.prototype.collectSnykFlags = function collectSnykFlags (callback) { Security.prototype.collectDependencies = function collectDependencies (callback) { var maxBuffer = 10 * 1024 * 1024 // 10mb - childProcess.execFile('npm', ['ls', '--json', '--production'], { + childProcess.execFile(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['ls', '--json', '--production'], { maxBuffer: maxBuffer }, function (error, stdout, stderr) { if (error) {