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



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>"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.