{"record":{"id":"c5f018acbc165c4c","repo":"mastra-ai/mastra","slug":"missing-mastra-core","errorCode":"MISSING_MASTRA_CORE","errorMessage":"MISSING_MASTRA_CORE","messagePattern":"MISSING_MASTRA_CORE","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/lint/rules/mastraCoreRule.ts","lineNumber":11,"sourceCode":"import type { LintContext, LintIssue, LintRule } from './types.js';\n\nexport const mastraCoreRule: LintRule = {\n  name: 'mastra-core',\n  description: 'Checks if @mastra/core is installed',\n  async run(context: LintContext): Promise<LintIssue[]> {\n    const hasCore = context.mastraPackages.some(pkg => pkg.name === '@mastra/core');\n    if (!hasCore) {\n      return [\n        {\n          code: 'MISSING_MASTRA_CORE',\n          severity: 'error',\n          scope: 'project',\n          message: '@mastra/core is not installed. This package is required for Mastra to work properly.',\n          fix: 'Install @mastra/core: pnpm add @mastra/core',\n        },\n      ];\n    }\n\n    return [];\n  },\n};\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/lint/rules/mastraCoreRule.ts#L1-L23","documentation":"A lint rule that verifies @mastra/core is present among the project's installed Mastra packages. @mastra/core is the required runtime dependency; without it, Mastra features cannot work. The rule reports a project-scoped lint issue (code MISSING_MASTRA_CORE).","triggerScenarios":"Running `mastra lint` in a project whose dependency list (node_modules / lockfile scan) contains Mastra packages but not '@mastra/core'.","commonSituations":"Installing only plugin packages (e.g. @mastra/client-js or a framework integration) without the core package, partially failed installs, or accidentally removing the dependency during cleanup.","solutions":["Install @mastra/core: `pnpm add @mastra/core` (or npm/yarn equivalent).","If it's in package.json but not installed, run `pnpm install` to fix a broken install.","Check that it wasn't marked as a devDependency/removed by dependency cleanup tooling.","Re-run `mastra lint` to confirm the issue is resolved."],"exampleFix":"// before (package.json)\n\"dependencies\": { \"@mastra/client-js\": \"^1.0.0\" }\n// after\n\"dependencies\": { \"@mastra/client-js\": \"^1.0.0\", \"@mastra/core\": \"^1.0.0\" }","handlingStrategy":"validation","validationCode":"const deps = { ...pkg.dependencies, ...pkg.devDependencies };\nif (!deps['@mastra/core']) {\n  console.warn('Install @mastra/core before running `mastra lint`');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include @mastra/core as a direct dependency when using any Mastra package.","Run `pnpm install` after editing package.json.","Check dependency-cleanup tools didn't remove @mastra/core as 'unused'."],"tags":["lint","dependencies","missing-package","configuration"],"backgroundTag":"missing-dependency","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}