I was trying to create a scratch org following the trailhead
I'm 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
Best Answer
You have to login first.
sfdx force:auth:web:login -d -a DevHub
(This is in the prior step, you can't work on them separately.)