Skip to content

[BUG]: npm ci fails after installing version 2.158.6 or newer #3692

Open

Description

@amurashincertinia

Before You Submit

  • I'm using the latest version of Salesforce CLI
  • I've searched the existing issues
  • I've run sf doctor to 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

  1. Create an empty directory with this package.json:

    {
      "name": "npm-ci-test",
      "devDependencies": {
        "@salesforce/cli": "^2.159.7"
      }
    }
  2. Run npm install to create a new package-lock.json.

  3. 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 dependency
  • npm warn Could not resolve dependency
  • npm 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-only repairs the lock file for a while. As soon as any other dependency is installed or updated, or the lock file is created again, npm ci fails again.
  • Pinning @salesforce/cli to 2.158.5 avoids the problem. This is what we use for now.

Screenshots or Log Files

No response

Activity

  1. github-actions commented on Nov 19, 2026

    @github-actions

    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.

  2. git2gus commented on Nov 19, 2026

    @git2gus

    This issue has been linked to a new work item: W-24976983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingWe're actively investigating this issueregressionIssue that regresses existing functionalityvalidatedVersion information for this issue has been validated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions