Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular-cli/blueprints/ng2/files/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.settings/

# IDE - VSCode
.vscode/
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
Expand Down
12 changes: 11 additions & 1 deletion packages/angular-cli/ember-cli/lib/tasks/npm-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down