Angular "ngcc failed to process" View Engine library in CI
On Angular versions that ship ngcc, the compatibility compiler converts older View Engine libraries to Ivy during install or build. When it cannot process a package (incompatible format, partial install), it fails and blocks the build.
What this error means
A postinstall or build step fails with "Error: ngcc failed to process ..." naming a dependency it could not convert to Ivy.
Compiling @some/legacy-lib : module as esm5
Error: ngcc failed to process /node_modules/@some/legacy-lib:
Failed to compile entry-point ... (es2015 as esm2015)Common causes
A library incompatible with this Angular major
A View Engine library that ngcc cannot convert for the installed Angular version fails processing.
A partial or corrupted node_modules
An interrupted install leaves a package in a state ngcc cannot read, so conversion fails.
How to fix it
Reinstall cleanly and re-run ngcc
- Remove
node_modulesand reinstall from the lockfile. - Let ngcc run again over a clean tree.
- If it still fails, the named library is incompatible.
rm -rf node_modules
npm ci
npx ngccUpgrade or replace the incompatible library
Update the named dependency to an Ivy-compatible release for your Angular major, or remove it.
npm install @some/legacy-lib@latestHow to prevent it
- Keep dependencies on Ivy-compatible versions for your Angular major.
- Cache
node_moduleskeyed on the lockfile so ngcc output is reused. - Run a clean
npm cirather than incremental installs in CI.