Installing auth0-angular is generating an error

I am using auth0-angular version 2.2.3 in my angular application. Locally the application is building correctly. When I build on github where the build is first doing an npm install, the following error is happening when building the appliction

Error: node_modules/@auth0/auth0-spa-js/dist/typings/dpop/utils.d.ts:1:26 - error TS2307: Cannot find module ‘dpop’ or its corresponding type declarations.

I am not getting this error when building locally and I do not have the folder auth0-spa-js/dist/typings/dpop/ created in node_modules folder. When I do an npm install locally I still do not have that folder. It looks like the npm install on github is getting a different version of auth0-spa-js even though I have version 2.2.3 of the auth0-angular in my packages.json file

Hi @judith1,

Welcome back to the Auth0 Community!

The error you’re seeing is caused by your GitHub build installing a newer version of the @auth0/auth0-spa-js library (a dependency of auth0-angular) than what you have on your local machine. The recommended solution is to use npm ci instead of npm install in your GitHub workflow to ensure you get a reproducible build that respects your package-lock.json file.

The npm ci command performs a clean install by deleting any existing node_modules and installing dependencies based strictly on the package-lock.json file, guaranteeing a reproducible build.

You should use npm ci to ensure your GitHub build environment installs the exact same dependency versions as your local environment.

  1. Commit Your Lock File: First, ensure that your package-lock.json file is committed to your Git repository. This file is the source of truth for your project’s dependencies.
  2. Update Your GitHub Workflow: In your GitHub workflow YAML file (e.g., .github/workflows/build.yml), find the step that runs npm install and change it to npm ci.

If you have any other questions, feel free to reach out.

Have a good one,
Vlad