Pages deployment for Angular, Build Fails

Hello,

I am having some issues trying to deploy my Angular application. The build is failing each time I try to deploy. I can run “ng build” successfully on my local computer but it fails on Cloudflare. Im not sure if I have file I’m missing from my .gitignore or what is going on.

I have an environment variable set up for NODE_VERSION matching the current version of my project

Here is the log when trying to deploy :

11:31:06.928	found 0 vulnerabilities
11:31:06.935	NPM modules installed
11:31:07.395	Installing Hugo 0.54.0
11:31:08.003	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
11:31:08.007	Started restoring cached go cache
11:31:08.021	Finished restoring cached go cache
11:31:08.127	go version go1.14.4 linux/amd64
11:31:08.138	go version go1.14.4 linux/amd64
11:31:08.140	Installing missing commands
11:31:08.140	Verify run directory
11:31:08.140	Executing user command: ng build 
11:31:08.147	/opt/build/bin/build: line 39: ng: command not found
11:31:08.151	Failed: build command exited with code: 127
11:31:08.883	Failed: an internal error occurred

Does anybody have any ideas on what I’m missing?

Is your repo public? If so, then can you link it. It seems the angular is not getting installed with NPM. I would check to make sure your package.json file is checked in.

Yes it is. Here is the path:
breckiam/ngPortfolio

It wont let me add a link into this post

Your structure is weird. You seem to what would go at the root of your repo under ngPortolio. I would move all that stuff up a level.

So basically get rid of the ngPorfolio Folder and move all of the contents inside of the folder to the root of the repo?

Yes. This would be the quickest and cleanest way to get it to build.

Your amazing that worked! Thank you very much :grinning:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.