We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ee90cd commit 3d61a48Copy full SHA for 3d61a48
packages/angular-cli/ember-cli/lib/tasks/npm-task.js
@@ -38,7 +38,17 @@ module.exports = Task.extend({
38
// npm otherwise is otherwise noisy, already submitted PR for npm to fix
39
// misplaced console.log
40
this.disableLogger();
41
- return spawn('npm', [this.command].concat(packages, npmOptions)).
+
42
+ // by default, use cnpm if installed
43
+ var strNPM = 'cnpm';
44
+ try {
45
+ console.log(require.resolve("cnpm"));
46
+ } catch(e) {
47
+ console.error("Cnpm is not found");
48
+ strNPM = 'npm';
49
+ }
50
51
+ return spawn(strNPM, [this.command].concat(packages, npmOptions)).
52
// return npm(this.command, packages, npmOptions, this.npm).
53
finally(this.finally.bind(this)).
54
then(this.announceCompletion.bind(this));
0 commit comments