angular/angular-cli · error
Package "${packageName}" has an invalid builders manifest pa
Error message
Package "${packageName}" has an invalid builders manifest path: "${buildersManifestRawPath}" What it means
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).
Source
Thrown at packages/angular_devkit/architect/node/node-modules-architect-host.ts:164
const [packageName, builderName] = builderStr.split(':', 2);
if (!builderName) {
throw new Error('No builder name specified.');
}
// Resolve and load the builders manifest from the package's `builders` field, if present
const packageJsonPath = localRequire.resolve(packageName + '/package.json', {
paths: [basePath],
});
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as { builders?: string };
const buildersManifestRawPath = packageJson['builders'];
if (!buildersManifestRawPath) {
throw new Error(`Package ${JSON.stringify(packageName)} has no builders defined.`);
}
let buildersManifestPath = path.normalize(buildersManifestRawPath);
if (path.isAbsolute(buildersManifestRawPath) || buildersManifestRawPath.startsWith('..')) {
throw new Error(
`Package "${packageName}" has an invalid builders manifest path: "${buildersManifestRawPath}"`,
);
}
buildersManifestPath = path.join(path.dirname(packageJsonPath), buildersManifestPath);
const buildersManifest = JSON.parse(
readFileSync(buildersManifestPath, 'utf-8'),
) as BuilderSchema;
const buildersManifestDirectory = path.dirname(buildersManifestPath);
// Attempt to locate an entry for the specified builder by name
const builder = buildersManifest.builders?.[builderName];
if (!builder) {
throw new Error(`Cannot find builder ${JSON.stringify(builderStr)}.`);
}
// Resolve alias reference if entry is a string
if (typeof builder === 'string') {View on GitHub (pinned to bb72145f9a)
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.
Example fix
// before (package.json) "builders": "../shared/builders.json" // after "builders": "./builders.json"
Defensive patterns
Strategy: validation
Validate before calling
const { builders } = require(require.resolve(`${packageName}/package.json`));
if (builders && (path.isAbsolute(builders) || builders.startsWith('..'))) throw new Error(`Invalid builders path: ${builders}`); Try / catch
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; } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Monorepo authors pointing builders at shared manifests outside the package; hand-editing package.json with a filesystem path; npm/yarn hoisting altering relative assumptions.
Related errors
- Package ${JSON.stringify(packageName)} has no builders defin
- Package "${packageName}" has an invalid builder implementati
- Circular builder alias references detected:
- No builder name specified.
- Cannot find builder ${JSON.stringify(builderStr)}.
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/4358563f1a8881fd.
Report an issue: GitHub.