title: Serverless Framework - Share code between multiple services
body: <p>I have multiple services</p>
  
  <pre><code>root/
      services/
          subscriptions/
          users/
      shared/
          httpUtils.js
          database.js
      node_modules/
      package.json
  </code></pre>
  
  <p>When I'm running severless locally using serverless-offline my imports work without a problem:</p>
  
  <pre><code>const _ = import('lodash') // module_modules
  const database = require('../../shared/database')
  
  However, when I deploy the application won't start because of
  error: cannot find module lodash
  error: cannot find module ../../shared/database
  </code></pre>
  
  <p>Does each service need to have its own node_modules dependencies within the service? It would be great if I could just load dependencies from a single node_modules at the root and the shared folder.</p>
  
  <p>What's the standard practice in order to accomplish this for a project with multiple services?</p>
  
  <ul>
  <li>each services gets its own copy of the shared files and node_modules?</li>
  <li>private npm package with shared libs?</li>
  <li>another packaging tool?</li>
  </ul>
  
  <p>Thanks.</p>