diff --git a/packages/angular-cli/blueprints/ng2/files/gitignore b/packages/angular-cli/blueprints/ng2/files/gitignore index d3080f0ffeb5..fe6f8a76b049 100755 --- a/packages/angular-cli/blueprints/ng2/files/gitignore +++ b/packages/angular-cli/blueprints/ng2/files/gitignore @@ -16,7 +16,7 @@ .settings/ # IDE - VSCode -.vscode/ +.vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json diff --git a/packages/angular-cli/ember-cli/lib/tasks/npm-task.js b/packages/angular-cli/ember-cli/lib/tasks/npm-task.js index 048e184983ce..1436d71e8fec 100644 --- a/packages/angular-cli/ember-cli/lib/tasks/npm-task.js +++ b/packages/angular-cli/ember-cli/lib/tasks/npm-task.js @@ -38,7 +38,17 @@ module.exports = Task.extend({ // npm otherwise is otherwise noisy, already submitted PR for npm to fix // misplaced console.log this.disableLogger(); - return spawn('npm', [this.command].concat(packages, npmOptions)). + + // by default, use cnpm if installed + var strNPM = 'cnpm'; + try { + console.log(require.resolve("cnpm")); + } catch(e) { + console.error("Cnpm is not found"); + strNPM = 'npm'; + } + + return spawn(strNPM, [this.command].concat(packages, npmOptions)). // return npm(this.command, packages, npmOptions, this.npm). finally(this.finally.bind(this)). then(this.announceCompletion.bind(this));