File tree 1 file changed +20
-0
lines changed
packages/angular_devkit/build_angular/src/browser 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -471,7 +471,27 @@ export function buildWebpackBrowser(
471
471
}
472
472
}
473
473
474
+ // Workaround Node.js issue prior to 10.16 with copyFile on macOS
475
+ // https://github.com/angular/angular-cli/issues/15544 & https://github.com/nodejs/node/pull/27241
476
+ let copyFileWorkaround = false ;
477
+ if ( process . platform === 'darwin' ) {
478
+ const version = process . versions . node . split ( '.' ) . map ( part => Number ( part ) ) ;
479
+ if (
480
+ version [ 0 ] < 10 ||
481
+ version [ 0 ] === 11 ||
482
+ ( version [ 0 ] === 10 && version [ 1 ] < 16 )
483
+ ) {
484
+ copyFileWorkaround = true ;
485
+ }
486
+ }
487
+
474
488
for ( const action of cacheActions ) {
489
+ if ( copyFileWorkaround ) {
490
+ try {
491
+ fs . unlinkSync ( action . dest ) ;
492
+ } catch { }
493
+ }
494
+
475
495
fs . copyFileSync ( action . src , action . dest , fs . constants . COPYFILE_FICLONE ) ;
476
496
if ( process . platform !== 'win32' ) {
477
497
// The cache writes entries as readonly and when using copyFile the permissions will also be copied.
You can’t perform that action at this time.
0 commit comments