title: How can i use package management in NodeJS Azure Functions?
body: <p>I'm trying to build this sample project as a Azure Function and it requires some packages <a href="https://github.com/OfficeDev/O365-Nodejs-Microsoft-Graph-App-only" rel="noreferrer">https://github.com/OfficeDev/O365-Nodejs-Microsoft-Graph-App-only</a></p>
  
  <p>I can see that I can use packet management in NodeJS Azure Functions using <a href="https://azure.microsoft.com/en-us/documentation/articles/functions-reference/#nodejavascript-api" rel="noreferrer">https://azure.microsoft.com/en-us/documentation/articles/functions-reference/#nodejavascript-api</a></p>
  
  <p>I tried to use this</p>
  
  <pre><code>var request = require('request');
  </code></pre>
  
  <p>This statement </p>
  
  <pre><code>You can include packages in your function directory (i.e. via npm install) and then import them to your function in the usual ways (i.e. via require('packagename'))
  </code></pre>
  
  <p>So I created a project.json with this in it like the C# Azure Function uses:</p>
  
  <pre><code>{
    "frameworks": {
      "net46":{
        "dependencies": {
          "chalk": "^1.1.1",
          "q": "^1.4.1",
          "request": "^2.67.0"
        }
      }
    }
  }
  </code></pre>
  
  <p>and get this error</p>
  
  <pre><code>2016-04-06T19:49:42.026 Exception while executing function: Functions.MicrosoftGraphWebHookNode. mscorlib: One or more errors occurred. Error: Cannot find module 'request'
      at Function.Module._resolveFilename (module.js:339:15)
      at Function.Module._load (module.js:290:25)
      at Module.require (module.js:367:17)
      at require (internal/module.js:16:19)
      at Object.&lt;anonymous&gt; (D:\home\site\wwwroot\MicrosoftGraphWebHookNode\index.js:1:77)
      at Module._compile (module.js:413:34)
      at Object.Module._extensions..js (module.js:422:10)
      at Module.load (module.js:357:32)
      at Function.Module._load (module.js:314:12)
      at Module.require (module.js:367:17).
  </code></pre>
  
  <p>Should the project.json work?</p>