angular/angular-cli · error
Package ${JSON.stringify(packageName)} has no builders defin
Error message
Package ${JSON.stringify(packageName)} has no builders defined. What it means
A builder package must declare a 'builders' field in its package.json pointing to its builders manifest JSON. resolveBuilder throws when the resolved package.json has no such field, meaning the package exports no builders.
Source
Thrown at packages/angular_devkit/architect/node/node-modules-architect-host.ts:159
throw new Error(
'Circular builder alias references detected: ' + [...seenBuilders, builderStr],
);
}
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) {View on GitHub (pinned to bb72145f9a)
Solutions
- Verify the package name in the builder string is the intended builder package.
- Check the package.json of the package for a 'builders' field.
- Use a different/older package version that defines builders, or publish the manifest.
Example fix
// before (package.json of my-builders)
{"name": "my-builders", "version": "1.0.0"}
// after
{"name": "my-builders", "version": "1.0.0", "builders": "./builders.json"} Defensive patterns
Strategy: validation
Validate before calling
const pkg = require.resolve(`${packageName}/package.json`, { paths: [process.cwd()] });
if (!require(pkg).builders) throw new Error(`Package "${packageName}" has no builders defined.`); Try / catch
try { await host.resolveBuilder(`${packageName}:x`); } catch (e) { if (String(e.message).includes('has no builders defined')) { /* pick the correct builder package */ } else throw e; } Prevention
- Confirm the package is a builder package (has 'builders' in package.json) before referencing it.
- Check `npm view <pkg> builders` before adding a dependency.
- Pin package versions to avoid upgrades that drop builder support.
When it happens
Trigger: Referencing a builder in an ordinary npm package (no 'builders' key in package.json), or referencing the wrong package name in the builder identifier.
Common situations: Typo'd package name so an unrelated package is resolved; using a library package instead of a builder package; a package that removed builder support in a newer version.
Related errors
- Package "${packageName}" has an invalid builders manifest pa
- Circular builder alias references detected:
- No builder name specified.
- Cannot find builder ${JSON.stringify(builderStr)}.
- Could not find the implementation for builder
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/1a17295ad574d77c.
Report an issue: GitHub.