{"record":{"id":"577a8909138bf2ab","repo":"quasarframework/quasar","slug":"could-not-generate-relativepath","errorCode":null,"errorMessage":"Could not generate ${relativePath}.","messagePattern":"Could not generate (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app-vite/lib/cmd/new.js","lineNumber":202,"sourceCode":"    const targetFolder = appPaths.resolve.app(relativePath)\n\n    if (!storeProvider.isInstalled) {\n      await storeProvider.install()\n    }\n\n    if (!fs.existsSync(targetFolder)) {\n      fse.ensureDir(targetFolder)\n\n      try {\n        fse.copySync(\n          appPaths.resolve.cli(\n            `templates/store/${storeProvider.name}/${format}`\n          ),\n          targetFolder\n        )\n      } catch (err) {\n        console.warn(err)\n        warn(`Could not generate ${relativePath}.`, 'FAIL')\n        process.exit(1)\n      }\n\n      log(`Generated ${relativePath}`)\n    }\n\n    return {\n      relativePath,\n      ext: format\n    }\n  }\n}\n\nconst { relativePath, ext, reference } = await getAsset(type)\nconst fullExt = `.${ext}`\n\nconsole.log()\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/cmd/new.js#L184-L220","documentation":"When creating a store for the first time, `quasar new store` bulk-copies the store template folder for the detected store provider (Pinia/Vuex) into src/<pathKey>. If that recursive copy throws, the CLI logs the error, warns 'Could not generate <path>' and exits with code 1 — the store is left unusable and must be regenerated.","triggerScenarios":"fse.copySync(appPaths.resolve.cli(`templates/store/${storeProvider.name}/${format}`), targetFolder) throwing — template folder missing for the provider/format combination, or target not writable (new.js:193-204). Only happens when src/stores or src/store does not exist yet.","commonSituations":"First store creation in a fresh project with a broken @quasar/app-vite install; forcing -f ts where the template set is incomplete; permission issues in the project directory; store provider auto-install (storeProvider.install) succeeded but template copy failed.","solutions":["Fix the underlying fs error shown in console.warn (permissions/disk space) and re-run `quasar new store <name>`.","Reinstall dependencies to restore templates: `rm -rf node_modules && pnpm install`.","Verify the store provider installed correctly (check package.json for pinia/vuex) and, if needed, create src/stores manually before retrying."],"exampleFix":"// before\n$ quasar new s auth -f ts  -> Could not generate src/stores. exit 1\n// after\n$ rm -rf node_modules && pnpm install\n$ quasar new s auth -f ts","handlingStrategy":"try-catch","validationCode":"import { accessSync, constants } from 'node:fs';\ntry { accessSync('.', constants.W_OK); } catch { console.error('project dir not writable'); }\n// also confirm store provider is declared: package.json contains pinia or vuex","typeGuard":null,"tryCatchPattern":"try {\n  execSync(`quasar new s ${name} ${fmt}`, { stdio: 'inherit' });\n} catch (err) {\n  // CLI exits 1 here; check store folder and reinstall deps before retry\n  reinstallDeps();\n  execSync(`quasar new s ${name} ${fmt}`, { stdio: 'inherit' });\n}","preventionTips":["Ensure a healthy node_modules (templates live in @quasar/app-vite/templates/store).","Verify the store provider (pinia/vuex) installs correctly before scaffolding.","Check disk space and permissions on src/ before first store generation."],"tags":["cli","scaffolding","store","filesystem"],"backgroundTag":"template-copy-failed","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}