title: Firebase - functions did not deploy properly - no such file or directory, open '/workspace/node_modules/shared/package.json
body: <p>In my firebase functions, I created a local package to share code in my angular application and my firebase functions. This seems to break the deploying of my code, as you will see in the log on the bottom.</p>
  <p>The folder structure is like this:</p>
  <pre><code>/frontend/..
  /backend/functions
  /shared/..
  </code></pre>
  <p>The package.json of my firebase functions has this entry:</p>
  <pre><code>&quot;my-shared&quot;: &quot;file:../../shared&quot;,
  </code></pre>
  <p>When I import the code from <code>my-shared</code>, it looks like this:</p>
  <pre><code>import { User } from &quot;my-shared/lib/models/user&quot;;
  </code></pre>
  <p>The <code>package.json</code> from the shared folder looks like this:</p>
  <pre><code>{
    &quot;name&quot;: &quot;my-shared&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;main&quot;: &quot;lib/index.js&quot;,
    &quot;scripts&quot;: {
      &quot;build&quot;: &quot;tsc&quot;,
      &quot;prepare&quot;: &quot;npm run build&quot;,
      &quot;watch&quot;: &quot;npx tsc --watch&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;typescript&quot;: &quot;^2.8.3&quot;
    },
    &quot;files&quot;: [
      &quot;lib/**/*&quot;
    ],
    &quot;dependencies&quot;: {
      &quot;json2typescript&quot;: &quot;^1.5.0-rc.0&quot;
    },
    &quot;private&quot;: true
  }
  </code></pre>
  <p>When I run firebase deploy, I got this error:</p>
  <pre><code>Error: Functions did not deploy properly.
  </code></pre>
  <p>Here a snippet of the log when running this:</p>
  <pre><code>firebase functions:log --only myFunction
  
  Build failed: npm ERR! code ENOENT\nnpm ERR! syscall open\nnpm ERR! path /workspace/node_modules/shared/package.json\nnpm ERR! errno -2\nnpm ERR! enoent ENOENT: no such file or directory, open '/workspace/node_modules/shared/package.json'\nnpm ERR! enoent This is related to npm not being able to find a file.\nnpm ERR!
  </code></pre>
  <p>What I did so far:</p>
  <ul>
  <li>npm install in shared</li>
  <li>rm -rf node_modules &amp;&amp; npm rm package-lock.json &amp;&amp; npm install in backend/functions</li>
  <li>for testing I replaced the absolute path of &quot;my-shared&quot;: &quot;file:../../shared&quot;</li>
  <li>tried <code>npm link</code>, but as I understand it correctly the line above should also work</li>
  <li>update node globally</li>
  <li>spend much time to solve this problem</li>
  </ul>
  <p>Is something wrong with my local package or is there a configuration missing? Would be great, if someone could help me here.</p>
  <p>By the way, the frontend has the same package.json entry and is compiling successfully.</p>