0

Per my understanding for using Scratch Orgs, you have to have a DevHub registered.

When you have to install an Unlocked Package in the Production Org that is registered as DevHub, do you have to unregister the Org as DevHub and registered as a normal Org or you can install the unlocked package using the DevHub Alias?

sfdx force:package:install -u DevHub --wait 10 --package [email protected] -k test1234 --noprompt

I am working in the Salesforce trailhead Quick Start: Unlocked Packages

1 Answer 1

3

No, you should not have to unregister your Dev Hub and register it again in order to use Unlocked Packages.

You can think of Dev Hub as identifying a capability of the org you've authenticated to - it's capable of being a Dev Hub for your scratch orgs. But you can have more than one Dev Hub, or none, and you can also execute other SFDX commands against those orgs that have nothing to do with their Dev Hub capabilities, such as installing packages or performing data loads.

The org alias "Dev Hub" is a useful convention, but it's not required - and has no special meaning to SFDX. You could call your Dev Hub by the alias "Prod" and SFDX would be fine with that, provided you address it appropriately using -u Prod.

You must, of course, have the appropriate permissions within the Dev Hub org to do so. If you're operating under a highly restricted permission set that only allows you to manipulate scratch orgs, you'll find other capabilities barred to you.

You must log in to answer this question.

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