Cannot find package '@angular/compiler-cli' imported from <workspace>/node_modules/ng-packagr/lib/utils/load-esm.js
The error
Cannot find package '@angular/compiler-cli' imported from
<workspace>/node_modules/ng-packagr/lib/utils/load-esm.js
happens when you run npm run build in a project inside an angular workspace. This happens because @angular/compiler-cli is not part of the dependencies or peerDependencies in the project's package.json. Adding the package to the peerDependencies resolves that issue.