Skip to content

Commit ebcc855

Browse files
authored
chore: revert back to moving files w/ fs-extra (#57030)
Follows #56917, revert back to moving files using `fs-extra`. This should help with the flaky `fs.rename` operation on Windows. cc @styfle
1 parent ab7b0f5 commit ebcc855

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/install-native.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import os from 'os'
22
import path from 'path'
33
import execa from 'execa'
44
import fs from 'fs'
5-
import fsp from 'fs/promises'
5+
import { move } from 'fs-extra'
66
;(async function () {
77
if (process.env.NEXT_SKIP_NATIVE_POSTINSTALL) {
88
console.log(
@@ -71,8 +71,7 @@ import fsp from 'fs/promises'
7171
const from = path.join(tmpdir, 'node_modules/@next', pkg)
7272
const to = path.join(cwd, 'node_modules/@next', pkg)
7373
// overwriting by removing the target first
74-
await fsp.rm(to, { recursive: true, force: true })
75-
return fsp.rename(from, to)
74+
return move(from, to, { overwrite: true })
7675
})
7776
)
7877
fs.rmSync(tmpdir, { recursive: true, force: true })

0 commit comments

Comments
 (0)