1

When attempting to list packages for a sandbox (Which is connected to a production org with devhub enabled and unlocked packages enabled) I get the following error:

Packaging is not enabled on this org. Verify that you are authenticated to the desired org and try again. Otherwise, contact Salesforce Customer Support for more information.

This is a new sandbox that was created after the devhub and unlocked packges were enabled. I can get a list of packages from a trailhead DE or from production, but not from sandboxes.

The command I am running is

sfdx force:package:list -v sandboxname

sandboxname is authenticated and connected. Any ideas?

3

sfdx force:package:list requires a dev hub. If you want to list packages in another type of org what you want is sfdx force:package:installed:list.

2

Sandboxes cannot be Dev Hubs or own packages. To enable Dev Hub, you must be in your

Developer Edition, trial, or production org (if you’re a customer), or your business org (if you’re an ISV).

Sandboxes' refresh cycles are not compatible with being the owner of a package and its associated version artifacts, which are expected to have an arbitrarily long lifespan. That's why those artifacts have to be owned by some species of production org. Further, your scratch org allocations and package version limits are tied to your production org.

(Similarly, you can't enable Environment Hub in a sandbox).

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.