quasarframework/quasar · critical
/src-cordova/package.json not found. Your setup seems broken
Error message
/src-cordova/package.json not found. Your setup seems broken. Please remove Cordova support and add it again.
What it means
When adding Cordova mode to a project where the mode is already installed, Quasar verifies src-cordova/package.json exists. If it doesn't, the scaffold is considered broken: this warning is printed, a blank line, and the process exits with code 1.
Source
Thrown at app-vite/lib/modes/cordova/cordova-installation.js:32
/**
* @param {{
* ctx: import('../../../types/configuration/context').InternalQuasarContext,
* silent: boolean,
* target: 'android' | 'ios' | undefined,
* appId?: string
* }} options
*/
export async function addMode({ ctx, silent, target, appId }) {
const {
appPaths,
pkg: { appPkg }
} = ctx
if (isModeInstalled(appPaths, 'cordova')) {
ensureWWW({ appPaths, forced: true })
if (!fse.existsSync(appPaths.resolve.cordova('package.json'))) {
warn(
'/src-cordova/package.json not found. Your setup seems broken. Please remove Cordova support and add it again.'
)
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'
View on GitHub (pinned to 4841521b5f)
Solutions
- Delete the src-cordova directory completely and re-add support: quasar mode remove cordova (or rm -rf src-cordova) then quasar mode add cordova.
- If you have valuable native customizations, instead recreate a minimal src-cordova/package.json (cordova devDependency + scripts) matching your installed cordova version before retrying.
- Check git history/backup for the lost package.json and restore it to avoid re-adding platforms and plugins.
Example fix
# before src-cordova/ (no package.json) # after rm -rf src-cordova quasar mode add cordova
Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs');
if (fs.existsSync('src-cordova') && !fs.existsSync('src-cordova/package.json')) {
// broken scaffold — remove and re-add before invoking quasar mode add cordova
fs.rmSync('src-cordova', { recursive: true, force: true });
} Prevention
- Never delete files inside src-cordova selectively; remove the whole folder when resetting Cordova support.
- Don't gitignore src-cordova/package.json — it defines the Cordova project and plugins.
- Check for a complete src-cordova scaffold after interrupting a `quasar mode add cordova` run.
When it happens
Trigger: addMode in cordova-installation.js, when isModeInstalled(appPaths,'cordova') is true but fse.existsSync(appPaths.resolve.cordova('package.json')) is false — i.e. a src-cordova directory exists without its package.json.
Common situations: A partially deleted src-cordova folder (package.json removed by hand, .gitignore mishap, or interrupted `quasar mode add cordova`); restoring the folder from VCS without package.json because it was gitignored.
Related errors
- App product name cannot start with a number. Please change t
- extendPackageJson() - cannot locate ${extPkg}. Skipping...
- extendPackageJson() - "${extPkg}" is a folder instead of fil
- extendPackageJson() - "${extPkg}" is malformed. Exiting...
- AppDelegate.m not found. Your App will revoke the devserver'
AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30).
Data as JSON: /api/errors/0eb25f042a779c4e.
Report an issue: GitHub.