title: SAM Node.js hello world app has axios module missing
body: <p>I am new to both Node.js and SAM.</p>
  
  <p>I am following the AWS Quick Start guide online <a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-quick-start.html" rel="nofollow noreferrer">here</a>, except that I am using Node.js. Specifically, I ran these commands:</p>
  
  <p>Versions:</p>
  
  <pre><code>▶ sam --version 
  SAM CLI, version 0.10.0
  ▶ node --version                                                               
  v8.15.0
  </code></pre>
  
  <p>Build:</p>
  
  <pre><code>▶ sam init --runtime nodejs
  ▶ cd sam-app/
  ▶ sam build
  ▶ sam package \
    --template-file template.yaml \
    --output-template-file packaged.yaml \
    --s3-bucket $s3_bucket
  ▶ sam deploy \
    --template-file packaged.yaml \
    --stack-name sam-app \
    --capabilities CAPABILITY_IAM
  </code></pre>
  
  <p>This all deploys the stack and the function fine, but it's then broken when I test it, because the axios module isn't there:</p>
  
  <pre><code>{
    "errorMessage": "Cannot find module 'axios'",
    "errorType": "Error",
    "stackTrace": [
      "Function.Module._load (module.js:474:25)",
      "Module.require (module.js:596:17)",
      "require (internal/module.js:11:18)",
      "Object.&lt;anonymous&gt; (/var/task/app.js:2:15)",
      "Module._compile (module.js:652:30)",
      "Object.Module._extensions..js (module.js:663:10)",
      "Module.load (module.js:565:32)",
      "tryModuleLoad (module.js:505:12)",
      "Function.Module._load (module.js:497:3)"
    ]
  }
  </code></pre>
  
  <p>The Axios module does seem to be in the build directory however:</p>
  
  <pre class="lang-none prettyprint-override"><code>▶ ls -1 sam-app/.aws-sam/build/HelloWorldFunction/node_modules 
  axios/
  debug/
  follow-redirects/
  is-buffer/
  ms/
  </code></pre>
  
  <p>But not in Lambda:</p>
  
  <p><a href="https://i.stack.imgur.com/90uD4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/90uD4.png" alt="AWS Console"></a></p>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/48356841/how-can-i-use-axios-in-lambda">this</a> other SO answer, but it doesn't help, because I thought SAM is supposed to package up all its dependencies.</p>
  
  <p>Does anyone know what is wrong?</p>