Repository navigation
Description
Before You Submit
- I'm using the latest version of Salesforce CLI
- I've searched the existing issues
- I've run
sf doctorto diagnose common issues
Related Issue
No response
Command
N/A
Org Type
Not applicable
Did this work before?
Yes, this is a regression
Last Working Version
2.158.5
Summary
Since @salesforce/cli 2.158.6, a project that lists @salesforce/cli as a dependency can no longer be installed with npm ci. npm install writes a package-lock.json that npm ci then reports as out of sync with package.json. The missing entries are @opentelemetry/* packages and basic-ftp. Version 2.158.5 works.
We install @salesforce/cli as a project devDependency so developer machines and CI use the same CLI version. Our DevOps team recommends this setup. It also means npm ci must work, because CI runs it.
The problem comes from @salesforce/cli alone. It reproduces in a new, empty npm project where @salesforce/cli is the only dependency.
Environment
@salesforce/cli: 2.158.6 and newer (tested up to 2.159.7); 2.158.5 works- Node.js: v24.22.1
- npm: 11.19.1
- OS: macOS (Darwin 25.6.0)
Repository to Reproduce
No response
Steps to reproduce
-
Create an empty directory with this
package.json:{ "name": "npm-ci-test", "devDependencies": { "@salesforce/cli": "^2.159.7" } } -
Run
npm installto create a newpackage-lock.json. -
Run
npm ci.
Expected Result
npm ci installs the dependencies from the package-lock.json that npm install just created and finishes without errors, as it does with @salesforce/cli@2.158.5.
Actual Result
npm ci prints many peer-dependency warnings, for example:
npm warn ERESOLVE overriding peer dependencynpm warn Could not resolve dependencynpm warn Conflicting peer dependency
It then fails with:
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 Missing: @opentelemetry/core@2.12.1 from lock file
npm error Missing: @opentelemetry/core@2.10.0 from lock file
npm error Missing: @opentelemetry/resources@2.10.0 from lock file
npm error Missing: @opentelemetry/core@1.30.1 from lock file
npm error Missing: @opentelemetry/resources@1.30.1 from lock file
npm error Missing: @opentelemetry/semantic-conventions@1.28.0 from lock file
npm error Missing: @opentelemetry/core@2.10.0 from lock file
npm error Missing: @opentelemetry/core@1.30.1 from lock file
npm error Missing: basic-ftp@5.3.1 from lock file
npm error Missing: @opentelemetry/resources@2.10.0 from lock file
npm error Missing: @opentelemetry/semantic-conventions@1.28.0 from lock file
Error Message
System Information
{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.159.7",
"nodeVersion": "node-v24.22.1",
"osVersion": "Darwin 25.6.0",
"rootPath": "~/work/npm-ci-test/node_modules/@salesforce/cli",
"shell": "zsh",
"pluginVersions": [
"@oclif/plugin-autocomplete 4.0.6 (core)",
"@oclif/plugin-commands 5.0.12 (core)",
"@oclif/plugin-help 7.0.7 (core)",
"@oclif/plugin-not-found 4.0.7 (core)",
"@oclif/plugin-plugins 7.0.16 (core)",
"@oclif/plugin-search 2.0.12 (core)",
"@oclif/plugin-update 5.0.10 (core)",
"@oclif/plugin-version 3.0.10 (core)",
"@oclif/plugin-warn-if-update-available 4.0.5 (core)",
"@oclif/plugin-which 4.0.10 (core)",
"@salesforce/cli 2.159.7 (core)",
"agent 2.3.0 (core)",
"apex 4.4.7 (core)",
"api 2.0.29 (core)",
"auth 6.0.5 (core)",
"code-analyzer 5.0.0 (user) published 569 days ago (Tue Apr 29 2025) (latest is 5.16.0)",
"community 4.0.6 (user) published 78 days ago (Tue Sep 01 2026) (latest is 4.0.27)",
"data 5.1.28 (core)",
"deploy-retrieve 4.3.3 (core)",
"info 4.0.26 (core)",
"lightning-dev 3.5.1 (user) published 449 days ago (Wed Aug 27 2025) (latest is 6.2.24)",
"limits 4.0.6 (core)",
"marketplace 2.0.28 (core)",
"org 7.0.15 (core)",
"packaging 3.0.17 (core)",
"schema 4.0.17 (core)",
"settings 3.0.25 (core)",
"sobject 2.0.26 (core)",
"telemetry 4.2.4 (core)",
"templates 57.6.1 (core)",
"trust 4.1.4 (core)",
"ui-bundle-dev 1.2.2 (user) published 232 days ago (Tue Mar 31 2026) (latest is 1.2.5)",
"user 6.0.13 (core)"
]
}Additional Information
Workarounds
- Running
npm i --package-lock-onlyrepairs the lock file for a while. As soon as any other dependency is installed or updated, or the lock file is created again,npm cifails again. - Pinning
@salesforce/clito2.158.5avoids the problem. This is what we use for now.
Screenshots or Log Files
No response
Activity
github-actions commentedon Nov 19, 2026
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
git2gus commentedon Nov 19, 2026
This issue has been linked to a new work item: W-24976983