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": "[email protected]"
              }
            ]
        }
    ],
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "51.0",
    "packageAliases": {
        "SegmentApp": "0Hoxxx",
        "[email protected]": "04txxx"
    }
}

1 Answer 1

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": "[email protected]"
            },
            {
                "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",
     "[email protected]": "04txxx"
  }
}
1
  • 1
    That was it @Mohith, thanks a bunch.
    – GeorgeA
    Commented Mar 22, 2021 at 1:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .