Skip to content

Commit 17c5928

Browse files
authored
fix: handle fs.realpath.native MAX_PATH issue for Node.js <18.10 (#14487)
1 parent 2de425d commit 17c5928

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vite/src/node/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ function windowsSafeRealPathSync(path: string): string {
606606
}
607607

608608
function optimizeSafeRealPathSync() {
609-
// Skip if using Node <16.18 due to MAX_PATH issue: https://github.com/vitejs/vite/issues/12931
609+
// Skip if using Node <18.10 due to MAX_PATH issue: https://github.com/vitejs/vite/issues/12931
610610
const nodeVersion = process.versions.node.split('.').map(Number)
611-
if (nodeVersion[0] < 16 || (nodeVersion[0] === 16 && nodeVersion[1] < 18)) {
611+
if (nodeVersion[0] < 18 || (nodeVersion[0] === 18 && nodeVersion[1] < 10)) {
612612
safeRealpathSync = fs.realpathSync
613613
return
614614
}

0 commit comments

Comments
 (0)