0

When I try to execute either of these two commands:

sfdx package version create -p 0Ho... --code-coverage --installation-key-bypass -b 2gp
# or
sf package version create -p 0Ho... --code-coverage --installation-key-bypass -b 2gp

I get this message...

Version create.... done

But when I run sf package version list, no new versions show up.

I am able to deploy the contents of the package to a scratch org without problems...

sf project deploy validate --source-dir force-app  
sf project deploy quick --job-id 0Af7...

My sfdx-project.json looks like this...

{
  "namespace": "myNamespace",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "57.0",
  "packageDirectories": [
    {
      "default": true,
      "path": "force-app",
      "package": "My Package (Internal)",
      "versionName": "Calliope 2023",
      "versionNumber": "1.1.0.NEXT",
      "ancestorVersion": "HIGHEST",
      "versionDescription": "Nice description goes here",
      "postInstallScript": "MyPackagePostInstall",
      "branch": "2gp-internal",
      "definitionFile": "config/project-scratch-def.json"
    },
    {
      "default": false,
      "path": "force-app",
      "package": "My Package (Production)",
      "versionName": "Calliope 2023",
      "versionNumber": "1.2.0.NEXT",
      "ancestorVersion": "HIGHEST",
      "versionDescription": "Nice description goes here",
      "postInstallScript": "MyPackagePostInstall",
      "branch": "2gp"
    }
  ],
  "packageAliases": {
    "My Package (Internal)": "0Ho...",
    "My Package (Production)": "0Ho..."
  }
}
sf version
@salesforce/cli/1.73.0 darwin-arm64 node-v18.16.0

If I add --verbose to the end of the command, it leaves out "done"...

Version create....

UPDATE: I contacted Salesforce Support and they told me it's a development issue so they couldn't help me.

This is absolutely an environmental issue. On a separate system, I installed @salesforce/cli and cloned my project then setup my connection to the DevHub and was able to generate a package version without any problems.

I tried removing @salesforce/cli and reinstalling but that didn't help. Not sure what in my environment is messed up but I can't seem to clear this issue. I've been using the other system to build the package versions in the meantime.

4
  • what about sfdx package version list vs sf package version list? The version shows up in your Devhub I assume since you can install.
    – ddeve
    Apr 17, 2023 at 14:20
  • Exactly the same output for listing package versions with sfdx and sf and it doesn't include the version I am trying to build. No errors. When I do a deploy validate to my scratch org, all 6 tests pass and it successfully lists all the assets the package. Apr 17, 2023 at 14:25
  • Did you find the answer? May 8, 2023 at 6:25
  • Seems to be environmental. May 9, 2023 at 15:01

2 Answers 2

0

Use the keyword HIGHEST with either the ancestorId or ancestorVersion attribute in the sfdx-project.json file in packageDirectories.

"packageDirectories": [{"path": "util", "package": "Expense Manager - Util", "versionNumber": "4.7.0.NEXT", "ancestorVersion": "HIGHEST"},

Please refer following document.

https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_config_ancestors.htm

1
  • Hi Ashwin. Thanks for the reply but my sfdx.json file (shown above) already is using the HIGHEST keyword for the ancestorVersion. Oct 12, 2023 at 15:03
0

The problem was that the @salesforce/plugin-packagin needed to be installed globally....

npm install -g @salesforce/plugin-packagin

You must log in to answer this question.

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