quasarframework/quasar · error
App product name cannot start with a number. Please change t
Error message
App product name cannot start with a number. Please change the "productName" prop in your /package.json then try again.
What it means
Cordova/iOS app identifiers and display names can't safely start with a digit, so before scaffolding Cordova mode Quasar validates the app name (productName, falling back to package.json name). A name starting with [0-9] aborts the add with this warning.
Source
Thrown at app-vite/lib/modes/cordova/cordova-installation.js:52
)
warn()
process.exit(1)
}
if (target) {
await ensureModeDeps('cordova', ctx)
await addPlatform(appPaths, target)
} else if (silent !== true) {
warn('Cordova support detected already. Aborting.')
}
return
}
const appName = appPkg.productName || appPkg.name || 'Quasar App'
if (/^[0-9]/.test(appName)) {
warn(
'App product name cannot start with a number. ' +
'Please change the "productName" prop in your /package.json then try again.'
)
return
}
const promptSession = await createPromptSession('Installing Cordova Mode...')
const answer = {
appId: await resolvePromptAnswer({
promptSession,
value: appId,
validate: val => {
if (!val) return 'The app id cannot be empty'
},
fallback: defaultAppId,
fallbackNote: `Using "${defaultAppId}" as the app id.`,
question: () =>View on GitHub (pinned to 4841521b5f)
Solutions
- Add or change "productName" in your /package.json to a name starting with a letter (productName overrides name for display purposes).
- If you can't change productName, rename the package "name" field to start with a letter before running quasar mode add cordova.
- Remember productName is also used in capacitor/electron modes — keep it a valid app display name (letters first, no leading digits).
Example fix
// package.json — before
{ "name": "4cast-app" }
// after
{ "name": "4cast-app", "productName": "Forecast App" } Defensive patterns
Strategy: validation
Validate before calling
const pkg = require(process.cwd() + '/package.json');
const appName = pkg.productName || pkg.name || '';
if (/^[0-9]/.test(appName)) {
throw new Error(`productName "${appName}" starts with a digit — fix /package.json before quasar mode add cordova`);
} Prevention
- Always set an explicit productName in package.json that starts with a letter.
- Validate package.json name/productName in CI before running mode-add commands.
- Keep the npm `name` lowercase/URL-safe and the productName human-friendly, both letter-initial.
When it happens
Trigger: addMode in cordova-installation.js: /^[0-9]/.test(appName) is true where appName = appPkg.productName || appPkg.name || 'Quasar App', when running quasar mode add cordova.
Common situations: package.json "name" like "4cast-app" or "3dviewer" without a productName set; productName accidentally numeric after a rename; auto-generated npm packages with digit-leading names.
Related errors
- /src-cordova/package.json not found. Your setup seems broken
- Build output directory must be a non-empty path
- Project directory must be a non-empty path
- Invalid SSR nonce. Expected a non-empty base64 or base64url
- extendPackageJson() - cannot locate ${extPkg}. Skipping...
AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30).
Data as JSON: /api/errors/71f270846c56a78b.
Report an issue: GitHub.