Pipeline build fails from unpinned Node/NPM and missing package-lock.json in AEM Cloud Manager

In AEM Cloud Manager, pipeline builds fail when Node and NPM versions aren’t set in the frontend-maven-plugin and the package-lock.json file isn’t committed. This leads to syntax errors or incompatibilities after environment or dependency updates. To fix this issue, pin compatible Node/NPM versions and commit the package-lock.json file.

Description description

Environment

Adobe Experience Manager

Issue/Symptoms

  • Pipeline fails during Build and Unit testing for all environments (DEV, Stage, PROD).
  • Error messages show JavaScript syntax incompatibility in a dependency during npm run production.
  • Error messages reference SyntaxError: Unexpected token . in baseline-browser-mapping dependency.
  • Builds that previously succeeded now fail without changes to code or dependencies.

Resolution resolution

To fix this issue, follow these steps:

  1. Update the POM file to specify compatible Node and NPM versions in the frontend-maven-plugin configuration.
  2. Run npm install locally to generate a new package-lock.json file.
  3. Commit the generated package-lock.json file to source control.
  4. Push these changes to your repository.
  5. Re-run the Cloud Manager pipeline.
  6. Verify the build completes successfully without syntax errors.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f