Commit 7d07bf3 1 parent b9b7f1b commit 7d07bf3 Copy full SHA for 7d07bf3
File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,13 @@ export default class Blueprint extends Command {
409
409
public installPackages ( pkgNames : string [ ] , dev ?: boolean ) : void {
410
410
debug ( `installing ${ pkgNames . join ( ', ' ) } ` ) ;
411
411
if ( this . shouldUseYarn ( ) ) {
412
- run ( `yarn add ${ dev ? '--dev' : '' } ${ pkgNames . join ( ' ' ) } ` ) ;
412
+ pkgNames . forEach ( ( pkgName ) => {
413
+ try {
414
+ run ( `yarn add ${ dev ? '--dev' : '' } ${ pkgName } ` ) ;
415
+ } catch ( e ) {
416
+ // Yarn fails the entire command if one package doesn't exist, so we run each separately
417
+ }
418
+ } ) ;
413
419
} else {
414
420
run ( `npm install ${ dev ? '-D' : '-S' } ${ pkgNames . join ( ' ' ) } ` ) ;
415
421
}
@@ -433,7 +439,13 @@ export default class Blueprint extends Command {
433
439
public uninstallPackages ( pkgNames : string [ ] ) : void {
434
440
debug ( `uninstalling ${ pkgNames . join ( ', ' ) } ` ) ;
435
441
if ( this . shouldUseYarn ( ) ) {
436
- run ( `yarn remove ${ pkgNames . join ( ' ' ) } ` ) ;
442
+ pkgNames . forEach ( ( pkgName ) => {
443
+ try {
444
+ run ( `yarn remove ${ pkgName } ` ) ;
445
+ } catch ( e ) {
446
+ // Yarn fails the entire command if one package doesn't exist, so we run each separately
447
+ }
448
+ } ) ;
437
449
} else {
438
450
run ( `npm uninstall -S ${ pkgNames . join ( ' ' ) } ` ) ;
439
451
}
You can’t perform that action at this time.
0 commit comments