The following chain of events had occured.
The Angular website application was pretty outdated, possibly v3 and was upgraded to 8.2.8, couldnt go all the way due to a dependency on mdbbootstrap which would require a rewrite in many places, made a change and the pipeline and check completed.
Coming back from another project i ran into this problem Angular project produces javascript error "core.js:23018 Uncaught TypeError: Cannot read properties of undefined (reading 'id')", which was solved by npm -ci
Now after making my current changes, and sending off to gitlab pipeline, the following errors occur
npm ERR! While resolving: angular-date-value-accessor@0.0.1
npm ERR! Found: @angular/core@8.2.14
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~8.2.8" from the root project
npm ERR! peer @angular/core@"8.2.14" from @angular/animations@8.2.14
npm ERR! node_modules/@angular/animations
npm ERR! @angular/animations@"~8.2.8" from the root project
npm ERR! peer @angular/animations@">=6.0.0 <9.0.0" from angular-calendar@0.26.11
npm ERR! node_modules/angular-calendar
npm ERR! angular-calendar@"^0.26.11" from the root project
npm ERR! 23 more (@angular/common, @angular/forms, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"^2.0.0" from angular-date-value-accessor@0.0.1
npm ERR! node_modules/angular-date-value-accessor
npm ERR! angular-date-value-accessor@"0.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/core@2.4.10
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"^2.0.0" from angular-date-value-accessor@0.0.1
npm ERR! node_modules/angular-date-value-accessor
npm ERR! angular-date-value-accessor@"0.0.1" from the root project
this is the gitlab-ci yaml
stage: build_staging
image: node:lts
script:
- grep -rli '%COMMIT_HASH%' * | xargs -i@ sed -i "s/%COMMIT_HASH%/$CI_COMMIT_SHORT_SHA/g" @
- cd src/Web
- npm install
- npm run buildstaging
artifacts:
paths:
- src/Web/dist/
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
only:
refs:
- develop
Deploy Web Staging:
stage: deploy_staging
image: xueshanf/awscli
script:
- cd src/Web
- aws s3 sync ./dist s3://$STAGING_BUCKET_NAME/ --delete
- echo "Invalidate index.html"
- aws cloudfront create-invalidation --distribution-id $STAGING_DISTRIBUTION_ID --paths /index.html
only:
refs:
- develop
(fyi its the build_staging that is the problem)
I am assuming what was fixed on my local machine is now no longer valid for npm install on npm:lts
What would be the proper course of direction, is it as simple as npm ci( a very demanding operation) instead of npm install ? or git clean ?
I also noticed, although everything works fine locally in package.json and lock it has
"@angular/core": "~8.2.8",
but in my node_modules it has 8.2.14 in /@angular/core/
after running npm ci