Cloudflare Pages build fails with ngcc: not found error

I have a nrwl workspace wtih an Angular app. Everything works locally, but it fails on the postinstall step with the message “ngcc: not found” before the build command gets a chance to run. I am at a loss as to why this happens. Any help would be appreciated.

20:53:24.441	> node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main
20:53:25.602	 >  NX   Decoration of the Angular CLI did not complete successfully
20:53:25.616	/tmp/ 1: /tmp/ ngcc: not found
20:53:25.624	npm ERR! code 127
20:53:25.624	npm ERR! path /opt/buildhome/repo
20:53:25.626	npm ERR! command failed
20:53:25.626	npm ERR! command sh /tmp/
20:53:25.628	npm ERR! A complete log of this run can be found in:
20:53:25.629	npm ERR!     /opt/buildhome/.npm/_logs/2022-09-30T00_52_48_234Z-debug-0.log
20:53:25.641	Error during NPM install
20:53:25.644	Failed: build command exited with code: 1
20:53:26.525	Failed: an internal error occurred
20:51:34.043	Success: Your site was deployed!

I figured this out. The nx migrations to update the workspace to v13 did not update decorate-angular-cli.js. I created a brand new nx workspace v13 and copied the file over, and now it is working.

1 Like