Open joerg-pfruender opened 2 months ago
This error occurs because the fork you are using isn't targeting angular 17 as a result the npm install -g @angular/cli
is trying to install angular 18 which requires a newer version of node you can fix the issue by using this amplify.yml
version: 1
backend:
phases:
build:
commands:
- npm ci --cache .npm --prefer-offline
- npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
frontend:
phases:
preBuild:
commands:
- nvm install 18.19.1
- nvm use 18.19.1
- node -v
- npm install -g @angular/cli@18.2.1
build:
commands:
- ng version
- ng build --configuration=production
artifacts:
baseDirectory: dist/<!YOUR ANGULAR PROECT NAME!>/browser
files:
- '**/*'
cache:
paths:
- .npm/**/*
- node_modules/**/*
Thank you. I can confirm that the solution from @dataminion worked for me.
@dataminion Thank you so much for your help! It works fine now.
Just one comment:
For the key baseDirectory
I have kept the value dist/amplify-angular-template/browser
because my repository has the name "amplify-angular-template" because I've simply forked the template repo without renaming.
So the general value is "dist/{here comes the name of your repo}/browser"
oh noes in my haste to answer a question I knew the answer to I leaked a private project codename to a public space.... ;-P thanks @joerg-pfruender I fixed it to make it a little more obvious to others.
@dataminion You have to delete your previous comment. Right click on the previous comment and there should be an option to delete it. Editing your comment is not enough.
yeah I only edited it for clarity I am not actually concerned about leaking the filepath from my project
I deployed a forked version of this template. The deployment fails with an error: