title: Is there a way to create an aws custom layer from Local nodejs modules?
body: <p>I created some custom aws layers and they work, but all of this layers have dependencies from npm repositories, what I want to do or to know (because I searched a lot but nothing found) is if this scenarios are possible:</p>
  <ul>
  <li>I have a <strong>fooModule</strong> without dependencies</li>
  <li>Then inside a nodejs folder I use <code>npm init - y</code> and then <code>npm i /path/to/fooModule</code></li>
  </ul>
  <p>My file structure at the end</p>
  <pre><code>nodejs
  --package.json (1)
  --node_modules
    --fooModule
      --index.js
      --package.json (2)
  </code></pre>
  <ul>
  <li>package.json (1) generated with npm init is</li>
  </ul>
  <pre><code>{
    &quot;dependencies&quot;: {
      &quot;fooModule&quot;: &quot;file:/path/to/fooModule&quot;
    }
  }
  </code></pre>
  <ul>
  <li>I make a zip and I get this message in my lambda after upload my zip</li>
  </ul>
  <p><code>Error: Cannot find module 'fooModule'\nRequire stack:\n- /var/task/src/handlers/index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js</code></p>
  <p>Questions:</p>
  <ul>
  <li>These messages are because of my fooModule reference ?</li>
  <li>Do I need to publish my module so I'll be able to create my layer ?</li>
  <li>What if I have 2 modules, fooModule and barModule and foo depends on bar ?</li>
  </ul>