mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 20:02:40 +08:00
The npm call uses the node exec() call which has a default limit of 200kb after which the process is terminated. When the user has set the info loglevel ng new terminates without any helpful error message. When using --quiet the loglevel is set to warning in any case resulting in a successful build. This is especially important for users of docker since the current node base image sets the loglevel to info. Close #5010
30 lines
897 B
TypeScript
30 lines
897 B
TypeScript
const Task = require('../ember-cli/lib/models/task');
|
|
import * as chalk from 'chalk';
|
|
import {exec} from 'child_process';
|
|
|
|
|
|
export default Task.extend({
|
|
run: function() {
|
|
const ui = this.ui;
|
|
let packageManager = this.packageManager;
|
|
if (packageManager === 'default') {
|
|
packageManager = 'npm';
|
|
}
|
|
|
|
return new Promise(function(resolve, reject) {
|
|
ui.writeLine(chalk.green(`Installing packages for tooling via ${packageManager}.`));
|
|
exec(`${packageManager} --quiet install`,
|
|
(err: NodeJS.ErrnoException, _stdout: string, stderr: string) => {
|
|
if (err) {
|
|
ui.writeLine(stderr);
|
|
ui.writeLine(chalk.red('Package install failed, see above.'));
|
|
reject();
|
|
} else {
|
|
ui.writeLine(chalk.green(`Installed packages for tooling via ${packageManager}.`));
|
|
resolve();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|