From c316e2dfb73ca13a84712d76deabefaf5616ee97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Thu, 26 Oct 2023 16:27:44 +0200 Subject: [PATCH] npm-scripts.ts: Fix replaceVersion() in Node 20 --- npm-scripts.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm-scripts.mjs b/npm-scripts.mjs index 7dfa06b2..44befd43 100644 --- a/npm-scripts.mjs +++ b/npm-scripts.mjs @@ -128,7 +128,8 @@ function replaceVersion() continue; } - const filePath = path.join('lib', file.name); + // NOTE: dirent.path is only available in Node >= 20. + const filePath = path.join(file.path ?? 'lib', file.name); const text = fs.readFileSync(filePath, { encoding: 'utf8' }); const result = text.replace(/__MEDIASOUP_CLIENT_VERSION__/g, PKG.version);