File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/angular-cli/ember-cli/lib/tasks Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,17 @@ module.exports = Task.extend({
3838 // npm otherwise is otherwise noisy, already submitted PR for npm to fix
3939 // misplaced console.log
4040 this . disableLogger ( ) ;
41- return spawn ( 'npm' , [ this . command ] . concat ( packages , npmOptions ) ) .
41+
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 ) ) .
4252 // return npm(this.command, packages, npmOptions, this.npm).
4353 finally ( this . finally . bind ( this ) ) .
4454 then ( this . announceCompletion . bind ( this ) ) ;
You can’t perform that action at this time.
0 commit comments