RequiresProjectError

Issue #2510 resolved
Ridowan Ahmed created an issue

When pressing CTRL+S in IntelliJ Idea, it’s giving me the following error.
RequiresProjectError: This command is required to run from within a Salesforce project directory. Code: RequiresProjectError

I’m using Windows11.

Comments (4)

  1. Scott Wells repo owner
    • changed status to open

    Hi. That error is coming from the Salesforce CLI, presumably because it's being invoked in a project that doesn't have an sfdx-project.json file. I'm honestly a bit confused as to why the CLI would be engaged for deployment, though, as it should only be used when that file is present. Can you please provide the project's .iml file for review?

  2. Ridowan Ahmed reporter

    I’ve deleted and then created a new project again. And it solve the problem.
    But now when I tried to retrieve metadata, I can’t select any of the checkbox.

    Here is the .iml file.

    <?xml version="1.0" encoding="UTF-8"?>
    <module type="GENERAL_MODULE" version="4">
      <component name="FacetManager">
        <facet type="IlluminatedCloud" name="Illuminated Cloud">
          <configuration>
            <option name="connectionName" value="CapitalGurus Partial" />
            <option name="connectionType" value="OAUTH" />
            <option name="defaultSourceRootUrl" value="file://$MODULE_DIR$/force-app/main/default" />
            <option name="moduleContents">
              <ModuleContents>
                <option name="contentSelectionType" value="PACKAGE_XML" />
                <option name="packageXmlRelativePath" value="manifest/package.xml" />
              </ModuleContents>
            </option>
          </configuration>
        </facet>
      </component>
      <component name="NewModuleRootManager" inherit-compiler-output="true">
        <exclude-output />
        <content url="file://$MODULE_DIR$">
          <sourceFolder url="file://$MODULE_DIR$/config" type="java-resource" />
          <sourceFolder url="file://$MODULE_DIR$/force-app/main/default" isTestSource="false" />
          <sourceFolder url="file://$MODULE_DIR$/manifest" type="java-resource" />
          <excludeFolder url="file://$MODULE_DIR$/.sf" />
          <excludeFolder url="file://$MODULE_DIR$/.sfdx" />
        </content>
        <orderEntry type="jdk" jdkName="IlluminatedCloud (CapitalGurusPartial/CapitalGurus Partial)" jdkType="IlluminatedCloud" />
        <orderEntry type="sourceFolder" forTests="false" />
      </component>
    </module>
    

  3. Log in to comment