Getting Error while creating scratch Org, how to resolve it?
When I was trying to create a scratch org and get stuck in the following section Create and Test Our Scratch Org - Step 2
while executing the following command getting the following error.
sfdx force:org:create -s -f config/project-scratch-def.json -a dreamhouse-org
ERROR running force:org:create: Must pass a username and/or OAuth options when creating an AuthInfo instance.
Steps Executed
- Created Project in VSCode
- Authorized an Org
- Executed Trailhead steps as mentioned in the link
You have to login first and authorize your Dev Hub on the same folder directory where you will create your scratch def org.
sfdx force:auth:web:login -d -a DevHub
This is in the prior step, you can't work on them separately.
VSCodeQuickstartmy_sfdx_projectdreamhouse-sfdx$ sfdx force:auth:web:login -d -a DevHub VSCodeQuickstartmy_sfdx_projectdreamhouse-sfdx$ sfdx force:org:create -s -f config/project-scratch-def.json -a dreamhouse-org
Scratch def org: The scratch def org is a source-driven and disposable deployment of Salesforce code and metadata. A scratch org is fully configurable, allowing developers to emulate different Salesforce editions with different features and preferences