title: How do I create a project (dependency) that I can share between other projects?
body: <p>I have a project A</p>
  <pre><code>// projectA/tsconfig.json
  {
      &quot;compilerOptions&quot;: {
          &quot;target&quot;: &quot;es2022&quot;,
          &quot;module&quot;: &quot;commonjs&quot;,
          &quot;outDir&quot;: &quot;./build&quot;,
          &quot;esModuleInterop&quot;: true,
          &quot;strict&quot;: true,
          &quot;skipLibCheck&quot;: true,
          &quot;moduleResolution&quot;: &quot;node&quot;,
      }
  }
  </code></pre>
  <pre><code>// projectA/package.json
  {
    &quot;name&quot;: &quot;project_a&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;devDependencies&quot;: {
      &quot;typescript&quot;: &quot;^4.7.4&quot;
    }
  }
  </code></pre>
  <pre><code>// projectA/src/main.ts
  export function projectAHello() {
      console.log(&quot;Hello from project A!&quot;)
  }
  </code></pre>
  <p>I am trying to import it in project B;</p>
  <pre><code>// projectB/tsconfig.json
  {
      &quot;compilerOptions&quot;: {
          &quot;target&quot;: &quot;es2022&quot;,
          &quot;module&quot;: &quot;commonjs&quot;,
          &quot;outDir&quot;: &quot;./build&quot;,
          &quot;esModuleInterop&quot;: true,
          &quot;strict&quot;: true,
          &quot;skipLibCheck&quot;: true,
          &quot;moduleResolution&quot;: &quot;node&quot;,
      }
  }
  </code></pre>
  <pre><code>// projectB/package.json
  {
    &quot;name&quot;: &quot;project_b&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;dependencies&quot;: {
      &quot;project_a&quot;: &quot;../projectA&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;typescript&quot;: &quot;^4.7.4&quot;
    }
  }
  </code></pre>
  <pre><code>// projectB/src/main.ts
  import projectAHello from &quot;project_a/main&quot;
  projectAHello()
  </code></pre>
  <p>But when I run the compiler in projectB, it gives me this:</p>
  <pre><code>❯ ./node_modules/.bin/tsc
  src/main.ts:1:27 - error TS2307: Cannot find module 'project_a/main' or its corresponding type declarations.
  </code></pre>
  <p>So how do I configure project A properly, so that project B can use its code?</p>