diff --git a/lib/helpers.js b/lib/helpers.js index 4ce0b1327c5a..88172a4b17bd 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -1,8 +1,8 @@ var path = require('path'); var fs = require('fs'); var chalk = require('chalk'); -var sh = require('shelljs'); var logger = console; +var spawnSync = require('spawn-sync'); exports.getPackageJson = function getPackageJson() { var packageJsonPath = path.resolve('package.json'); @@ -87,9 +87,12 @@ exports.codeLog = function codeLog(codeLines, leftPadAmount) { }; exports.installNpmDeps = function () { - var done = exports.commandLog('Installing NPM dependencies'); - var result = sh.exec('npm install', { silent: true }); - if (result.code !== 0) { + var done = exports.commandLog('Preparing to install NPM dependencies'); + done(); + + var result = spawnSync('npm', ['install'], { stdio: 'inherit' }); + done = exports.commandLog('Installing NPM dependencies'); + if (result.status !== 0) { done('An error occured while running `npm install`.', result.stderr); process.exit(1); } diff --git a/package.json b/package.json index 98a76d59b6f6..466ad1ec914e 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "commander": "^2.9.0", "merge-dirs": "^0.2.1", "shelljs": "^0.7.3", + "spawn-sync": "^1.0.15", "update-notifier": "^1.0.2" }, "devDependencies": {