Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Getting Error while creating scratch Org, how to resolve it?

Asked by Chloe Burgess Aug 5, 2021 1.2K views 4 answers
Share

About this question

When I was trying to create a scratch org and get stuck in the following section Create and Test Our Scratch Org - Step 2

https://trailhead.salesforce.com/content/learn/projects/quick-start-salesforce-dx/create-and-test-our-scratch-org?trail_id=sfdx_get_started 

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

  1. Created Project in VSCode
  2. Authorized an Org
  3. Executed Trailhead steps as mentioned in the  link

Your answer

4 Answers

Herath Latest answer

Answered on Jul 29, 2025

hi
Was this helpful?

Taylo Elle

Answered on Nov 20, 2024

If you're encountering the error "Must pass a username and/or OAuth options when creating an AuthInfo instance" while creating a scratch org in Salesforce DX, ensure you first authorize your Dev Hub using sfdx force:auth:web:login -d -a DevHub in the correct project directory.  Openguessr

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.