Hide npm output by default (#431)

Fixes: https://github.com/emscripten-core/emscripten/issues/10291
This commit is contained in:
Sam Clegg
2020-01-28 17:12:31 -08:00
committed by GitHub
parent ba53d20e94
commit deaa7e4bfd
2 changed files with 12 additions and 1 deletions

View File

@@ -1276,7 +1276,17 @@ def emscripten_npm_install(tool, directory):
npm = os.path.join(node_path, 'npm' + ('.cmd' if WINDOWS else ''))
env = os.environ.copy()
env["PATH"] = node_path + os.pathsep + env["PATH"]
subprocess.check_call([npm, 'ci', '--production'], cwd=directory, env=env)
print('Running post-install step: npm ci ...')
try:
subprocess.check_output(
[npm, 'ci', '--production'],
cwd=directory, stderr=subprocess.STDOUT, env=env,
universal_newlines=True)
except subprocess.CalledProcessError as e:
print('Error running %s:\n%s' % (e.cmd, e.output))
return False
print('Done running: npm ci')
return True