Hello Ohana,
I was trying to complete this trail using my free dev org. But I got a strange error while creating the scratch org. So, after spending 5 mins, I found the solution. So, lets save our 5 mins đ
Steps to create a Scratch Org:
- In Visual Studio Code, press Ctrl + Shift + P.
- Type sfdx.
- Select SFDX: Create a Default Scratch Org….
- Press Enter to accept the defaultÂ
project-scratch-def.json
. - Press Enter to accept the defaultÂ
trailhead
 scratch org alias. - Press Enter to accept the defaultÂ
7 days
 scratch org duration.
Error: You do not have access to the [ScratchOrgInfo] object
RCA: So basically, you havenât enabled scratch org feature in your org
You need to Enable Dev Hub to:
- Create and manage scratch orgs from the command line
Scratch orgs are disposable Salesforce orgs that are used to support development and testing. They are fully configurable, allowing developers to emulate different Salesforce editions with different features and preferences. - View information about your scratch orgs
Information includes details about requested scratch orgs, including whether they are active, expired or deleted. - Link namespace orgs
You can link namespace orgs to the Dev Hub for using scratch orgs with namespaces.
Steps to Enable Dev Hub:
- Go to Setup
- Search âDev Hubâ
- Toggle the âEnable Dev Hubâ Switch to make this Enabled
- All set, đ
Note: You can’t disable this feature once enabled.