I have setted up the frontend pipeline for cloud and is working smoothly in one of my sandbox instances.
The same theme sources when trying to build on client environment, it is getting failed.
Both the sandbox and client environment uses the same node version and all the content inside package.json and packag-lock.json are exactly the same.
Below is the error Im getting when executing the FE pipeline in client environment:
[BUILD] Running git clone command(s)
Cloning into 'XYZ-aem-code-repository'...
Executing command git fetch
Executing command git checkout AWMV2-904-Fix-Frontend-Pipeline
Switched to a new branch 'AWMV2-904-Fix-Frontend-Pipeline'
Branch 'AWMV2-904-Fix-Frontend-Pipeline' set up to track remote branch 'AWMV2-904-Fix-Frontend-Pipeline' from 'origin'.
[BUILD] Running git change-log command(s)
[BUILD] Running npm audit command(s)
Executing command npm --progress false audit --production --audit-level=critical
npm warn config production Use `--omit=dev` instead.
found 0 vulnerabilities
[BUILD] Running npm install command(s)
Executing command npm --progress false ci
npm error code EUSAGE
npm error
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Invalid: lock file's npm@11.0.0 does not satisfy npm@9.9.4
npm error
npm error Clean install a project
npm error
npm error Usage:
npm error npm ci
npm error
npm error Options:
npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
npm error [--no-bin-links] [--no-fund] [--dry-run]
npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm error [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm error
npm error aliases: clean-install, ic, install-clean, isntall-clean
npm error
npm error Run "npm help ci" for more info
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-01-30T14_19_03_793Z-debug-0.log
Both are having the AEM release version: 2025.1.19149.20250116T154450Z
Any insights?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @jezwn ,
Your package-lock.json file specifies npm@11.0.0, but your client environment is using npm@9.9.4. In this case you can try below steps:
1. If your sandbox uses npm@11.0.0 but the client environment is on npm@9.9.4, update npm in the client environment.
npm install -g npm@11.0.0
2. npm ci strictly enforces the lockfile integrity, if there is any mismatch
rm -rf node_modules package-lock.json
npm install
npm ci
3. If nvm (Node Version Manager) is being used, check which version is active.
nvm list
nvm use <expected-version>
Regards,
Hi @jezwn
Check if any --legacy-peer-deps is set in the file. If yes, remove that and try to build the same
This will cause npm install command to alter the package-lock.json file.
Other way you can try below -
Try to the remove the package-lock.json and run the build. This will generate new file during build
Hope this helps
Thanks
Hi @jezwn ,
Your package-lock.json file specifies npm@11.0.0, but your client environment is using npm@9.9.4. In this case you can try below steps:
1. If your sandbox uses npm@11.0.0 but the client environment is on npm@9.9.4, update npm in the client environment.
npm install -g npm@11.0.0
2. npm ci strictly enforces the lockfile integrity, if there is any mismatch
rm -rf node_modules package-lock.json
npm install
npm ci
3. If nvm (Node Version Manager) is being used, check which version is active.
nvm list
nvm use <expected-version>
Regards,
Fixed same issue with this steps.
Thank you @Shiv_Prakash_Patel
1. Update npm in the client environment:
Ensure that the client environment uses the same version of npm as your sandbox environment (i.e., npm@11.0.0). You can update npm by running:
npm install -g npm@11.0.0
After updating npm, you can try running the pipeline again.
2. Re-generate package-lock.json: It may also help to regenerate the package-lock.json to ensure it's correctly aligned with the npm version you're using. You can do this by following these steps:
- Delete the existing package-lock.json file
- Run npm install in your sandbox environment to regenerate a new package-lock.json
- Commit the new package-lock.json to your repository
- Then, run the pipeline again in the client environment.