diff --git a/apps/create-kunkun/build.ts b/apps/create-kunkun/build.ts index 370246a..13027d6 100644 --- a/apps/create-kunkun/build.ts +++ b/apps/create-kunkun/build.ts @@ -55,7 +55,10 @@ for (const p of fs.readdirSync(tmpDistTemplatesPath)) { // Replace local template with remote schema patchManifestJsonSchema(pkgJsonPath) // remove node_modules - fs.rmdirSync(path.join(distPath, "templates", p, "node_modules"), { recursive: true }) + const nodeModulesPath = path.join(distPath, "templates", p, "node_modules") + if (fs.existsSync(nodeModulesPath)) { + fs.rmdirSync(nodeModulesPath, { recursive: true }) + } } }