From 595dcf64b991e904c1b06847f64d107723c2cc62 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 28 Aug 2018 09:20:28 +0200 Subject: [PATCH] lib: fix npm pack Closes `stdin` and `stderr` when calling `npm pack`. This makes CITGM work with more recent versions of `npm`. Fixes: https://github.com/nodejs/citgm/issues/593 --- lib/grab-project.js | 10 +++------- package.json | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/grab-project.js b/lib/grab-project.js index 1f83f9737..a768e791f 100644 --- a/lib/grab-project.js +++ b/lib/grab-project.js @@ -16,13 +16,9 @@ function grabProject(context, next) { let bailed = false; context.emit('data', 'info', context.module.name + ' npm:', 'Downloading project: ' + packageName); - const proc = - spawn( - 'npm', - ['pack', packageName], - createOptions( - context.path, - context)); + let options = createOptions(context.path, context); + options.stdio = ['ignore', 'pipe', 'ignore']; + const proc = spawn('npm', ['pack', packageName], options); let filename = ''; diff --git a/package.json b/package.json index 498ab07a2..4145987cc 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "test": "npm run lint && npm run tap", - "tap": "tap -J --timeout 120 \"test/**/test-*.js\"", + "tap": "tap -J --timeout 240 \"test/**/test-*.js\"", "coverage": "npm run tap -- --coverage", "coverage-html": "npm run tap -- --coverage --coverage-report=html", "lint": "eslint bin/* lib/ test/ --cache"