From 27bb9e8a15971a3661eeb37dc6c4efba448b9166 Mon Sep 17 00:00:00 2001 From: CoalYa <1335334055@qq.com> Date: Thu, 15 Aug 2024 23:26:47 +0800 Subject: [PATCH] fix(did-you-know): mkdirSync may fail --- did-you-know/src/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/did-you-know/src/plugin.ts b/did-you-know/src/plugin.ts index e05f955f965d..c21f2faba6d6 100644 --- a/did-you-know/src/plugin.ts +++ b/did-you-know/src/plugin.ts @@ -69,7 +69,7 @@ export default (api: any) => { const cacheDir = path.join(api.paths.absNodeModulesPath, '.cache'); if (!fs.existsSync(cacheDir)) { - fs.mkdirSync(cacheDir); + fs.mkdirSync(cacheDir, { recursive: true }); } fs.writeFileSync(recordJSONPath, JSON.stringify(records), 'utf-8'); });