File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/angular_devkit/build_angular/src/browser Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -471,7 +471,23 @@ 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 ( version [ 0 ] < 10 || version [ 0 ] === 11 || version [ 0 ] === 10 && version [ 1 ] < 16 ) {
480
+ copyFileWorkaround = true ;
481
+ }
482
+ }
483
+
474
484
for ( const action of cacheActions ) {
485
+ if ( copyFileWorkaround ) {
486
+ try {
487
+ fs . unlinkSync ( action . dest ) ;
488
+ } catch { }
489
+ }
490
+
475
491
fs . copyFileSync ( action . src , action . dest , fs . constants . COPYFILE_FICLONE ) ;
476
492
if ( process . platform !== 'win32' ) {
477
493
// 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