1

We have two unlocked packages, package a and package b. Package A depends on Package B. Package B has a dependency to a managed package from the App Exchange.

I was able to create Package B without an any issues, but when attempting to run sfdx force:package:version:create for Package A, I am presented with this error:

An error occurred while trying to install a package dependency, ID 04txxxxx: The package you're installing depends on package 'Salesforce CPQ', version '230.5'. Install package 'Salesforce CPQ' in the target org before you install package 'SegmentApp'.

This is my sfdx-project.json for Package A:

{
    "packageDirectories": [
        {
            "path": "xxx",
            "default": true,
            "package": "xxxx",
            "versionName": "Version 1.0",
            "versionNumber": "1.0.0.NEXT",
            "dependencies": [
                {
                    "package": "segment-app",
                    "versionNumber": "1.0.0.LATEST"
                },
                {
                    "package": "partner-contact-data",
                    "versionNumber": "1.0.0.LATEST"
                }
            ]
        }
    ],
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "51.0",
    "packageAliases": {
        "DoceboIntegration": "0Ho1xxx",
        "partner-contact-data": "0Ho1xxx",
        "segment-app": "0Hoxxx"
    }
}

This is it for Package B:

    "packageDirectories": [
        {
            "path": "xxx",
            "default": true,
            "package": "xxx",
            "versionName": "Version 1.0",
            "versionNumber": "1.0.0.NEXT",
            "dependencies": [
              {
                "package": "salesforce-cpq@230.5"
              }
            ]
        }
    ],
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "51.0",
    "packageAliases": {
        "SegmentApp": "0Hoxxx",
        "salesforce-cpq@230.5": "04txxx"
    }
}
2

You will need to make sure to declare the Managed Package dependencies as well for Package A since it indirectly depends on the Managed Package.

{
"packageDirectories": [
    {
        "path": "xxx",
        "default": true,
        "package": "xxxx",
        "versionName": "Version 1.0",
        "versionNumber": "1.0.0.NEXT",
        "dependencies": [
            {
                "package": "salesforce-cpq@230.5"
            },
            {
                "package": "segment-app",
                "versionNumber": "1.0.0.LATEST"
            },
            {
                "package": "partner-contact-data",
                "versionNumber": "1.0.0.LATEST"
            }
        ]
    }
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "51.0",
"packageAliases": {
    "DoceboIntegration": "0Ho1xxx",
    "partner-contact-data": "0Ho1xxx",
    "segment-app": "0Hoxxx",
     "salesforce-cpq@230.5": "04txxx"
  }
}
1
  • 1
    That was it @Mohith, thanks a bunch. Mar 22 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.