1 | const { printLog } = require('./log');
|
2 | const { spawnSync } = require('child_process');
|
3 | const chalk = require('chalk');
|
4 |
|
5 | /**
|
6 | * npm install
|
7 | * @param path {String} Absolute path to a text file.
|
8 | */
|
9 | const invokeNpmInstall = function(path) {
|
10 | printLog(chalk.green('Execute'), 'npm install --production');
|
11 | return spawnSync('npm', ['install', '--production'], {
|
12 | cwd: path,
|
13 | env: process.env,
|
14 | stdio: 'inherit'
|
15 | });
|
16 | };
|
17 |
|
18 | module.exports = {
|
19 | invokeNpmInstall
|
20 | };
|