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 GIFter@1.0.0-1 -k test1234 --noprompt

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

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.

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.