diff --git a/.changeset/eight-swans-divide.md b/.changeset/eight-swans-divide.md new file mode 100644 index 000000000..84484d94b --- /dev/null +++ b/.changeset/eight-swans-divide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Use `fs.promises.rm` to remove node deprecation warning diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index ee0877a19..3746fc583 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -270,7 +270,7 @@ async function cleanSsrOutput(opts: StaticBuildOptions) { const url = new URL(filename, out); const folder = await fs.promises.readdir(url); if (!folder.length) { - await fs.promises.rmdir(url, { recursive: true }); + await fs.promises.rm(url, { recursive: true, force: true }); } }) );