I'm attempting to create an Apex Class a part of the Convert Lightning Web Components Open Source to Salesforce trailhead module and when I try to create a class on my mac, I run into this error.

sfdx force:apex:class:create --classname SessionController --template DefaultApexClass -n SessionController --outputdir force-app/main/default/classes ERROR running force:apex:class:create: A name parameter is required to create a storage

  • Getting the same thing now when creating a project. When running with --json you can at least get a stack trace, trying to look at the code to see if I can find a root cause...
    – Frans
    Commented Jul 22, 2021 at 18:05

1 Answer 1



Using that issue discussion as reference. I would check that you don't have some package.json file without any name attribute in the root folder of the system directory.

Otherwise, even adding package.json with the name attribute seems to be the other suggested workaround

    "name": "<anything>"
  • 1
    So apparently the problem is that if you have a package.json in any of the parent directories of the directory you're trying to create a new project from, you get this error. I had a package.json in ../.. and deleted it,and that fixed it.
    – Frans
    Commented Jul 22, 2021 at 18:08
  • Not sure if you checked before deleting, but did that "other" package.json have no name attribute? Commented Jul 22, 2021 at 18:44
  • I did not check, but I assume it didn't.
    – Frans
    Commented Jul 24, 2021 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .