{"record":{"id":"4358563f1a8881fd","repo":"angular/angular-cli","slug":"package-packagename-has-an-invalid-builders-m","errorCode":null,"errorMessage":"Package \"${packageName}\" has an invalid builders manifest path: \"${buildersManifestRawPath}\"","messagePattern":"Package \"(.+?)\" has an invalid builders manifest path: \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/architect/node/node-modules-architect-host.ts","lineNumber":164,"sourceCode":"    const [packageName, builderName] = builderStr.split(':', 2);\n    if (!builderName) {\n      throw new Error('No builder name specified.');\n    }\n\n    // Resolve and load the builders manifest from the package's `builders` field, if present\n    const packageJsonPath = localRequire.resolve(packageName + '/package.json', {\n      paths: [basePath],\n    });\n\n    const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as { builders?: string };\n    const buildersManifestRawPath = packageJson['builders'];\n    if (!buildersManifestRawPath) {\n      throw new Error(`Package ${JSON.stringify(packageName)} has no builders defined.`);\n    }\n\n    let buildersManifestPath = path.normalize(buildersManifestRawPath);\n    if (path.isAbsolute(buildersManifestRawPath) || buildersManifestRawPath.startsWith('..')) {\n      throw new Error(\n        `Package \"${packageName}\" has an invalid builders manifest path: \"${buildersManifestRawPath}\"`,\n      );\n    }\n\n    buildersManifestPath = path.join(path.dirname(packageJsonPath), buildersManifestPath);\n    const buildersManifest = JSON.parse(\n      readFileSync(buildersManifestPath, 'utf-8'),\n    ) as BuilderSchema;\n    const buildersManifestDirectory = path.dirname(buildersManifestPath);\n\n    // Attempt to locate an entry for the specified builder by name\n    const builder = buildersManifest.builders?.[builderName];\n    if (!builder) {\n      throw new Error(`Cannot find builder ${JSON.stringify(builderStr)}.`);\n    }\n\n    // Resolve alias reference if entry is a string\n    if (typeof builder === 'string') {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/architect/node/node-modules-architect-host.ts#L146-L182","documentation":"The builders manifest path declared in package.json must be relative and stay inside the package. resolveBuilder throws when the 'builders' value is an absolute path or starts with '..' (escaping the package directory).","triggerScenarios":"A package.json 'builders' field set to '/abs/path/builders.json' or '../shared/builders.json'; a symlinked or hoisted install layout producing such a value.","commonSituations":"Monorepo authors pointing builders at shared manifests outside the package; hand-editing package.json with a filesystem path; npm/yarn hoisting altering relative assumptions.","solutions":["Change the 'builders' field to a path relative to the package root (e.g. './builders.json').","Copy the manifest into the package instead of referencing external files.","Reinstall/rebuild the package if the installed package.json was corrupted."],"exampleFix":"// before (package.json)\n\"builders\": \"../shared/builders.json\"\n// after\n\"builders\": \"./builders.json\"","handlingStrategy":"validation","validationCode":"const { builders } = require(require.resolve(`${packageName}/package.json`));\nif (builders && (path.isAbsolute(builders) || builders.startsWith('..'))) throw new Error(`Invalid builders path: ${builders}`);","typeGuard":null,"tryCatchPattern":"try { await host.resolveBuilder(builderStr); } catch (e) { if (String(e.message).includes('invalid builders manifest path')) { /* fix package.json 'builders' to a relative in-package path */ } else throw e; }","preventionTips":["Always declare 'builders' as a relative path like './builders.json'.","Bundle shared manifests into each package rather than referencing parent dirs.","Smoke-test package installs (npm pack + install) to catch path issues."],"tags":["angular","builder","package","path"],"backgroundTag":"invalid-manifest-path","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}