title: How can I get the Amazon Cognito Identity SDK working in Aurelia?
body: <p>I am trying to get the Amazon Cognito Identity SDK working in Aurelia. I do not have a lot of Javascript experience and am very unfamiliar with the various dependency systems.</p>
  
  <p>I installed the Cognito SDK using: <code>npm install --save amazon-cognito-identity-js</code></p>
  
  <p>I then edited my <code>aurelia_project/aurelia.json</code> file as suggested in the Aurelia documentation to include a new client library dependency in build.bundles vendor-bundle dependencies:</p>
  
  <pre><code>"sjcl",
  "jsbn",
  {
    "name": "aws-sdk",
    "path": "../node_modules/aws-sdk/",
    "main": "dist/aws-sdk"
  },
  {
    "name": "amazon-cognito-identity-js",
    "path": "../node_modules/amazon-cognito-identity-js/dist",
    "main": "amazon-cognito-identity.min"
  }
  </code></pre>
  
  <p>However, when I try to run the code using <code>au run</code> I get the error: <code>Error: ENOENT: no such file or directory, open '/Users/nathanskone/Projects/scc/aurelia-app/src/xmlbuilder.js'</code></p>
  
  <p>I have tried to include xmlbuilder in my aurelia.json to no avail. When it is included I end up getting this error about lodash: <code>Error: ENOENT: no such file or directory, open '/Users/nathanskone/Projects/scc/aurelia-app/src/lodash/object/assign.js'</code></p>
  
  <p>I haven't found any way to get past the lodash error.</p>
  
  <p>Is there anyone out there familiar with the Aurelia dependency system that could help?</p>
  
  <p>Thanks,
  Nathan</p>
  
  <p><strong>EDIT #2:</strong> While I got past the xmlbuilder/lodash errors, I have run into further errors trying to bundle the aws-sdk. Here is my current aurelia.json:</p>
  
  <pre><code>"dependencies": [
    {
      "name": "xmlbuilder",
      "path": "../node_modules/xmlbuilder/lib",
      "main": "index"
    },
    {
      "name": "aws-sdk",
      "path": "../node_modules/aws-sdk",
      "main": "index",
      "resources": ["lib/region_config.json"]
    },
  </code></pre>
  
  <p>And the error I am currently getting:</p>
  
  <p><code>Error: ENOENT: no such file or directory, open '/Users/nathanskone/Projects/scc/aurelia-app/src/crypto.js'</code></p>
  
  <p>If I remove the resources (lib/region_config.json) then I get this error instead:
  <code>Error: ENOENT: no such file or directory, open '/Users/nathanskone/Projects/scc/aurelia-app/node_modules/aws-sdk/lib/region_config.json.js'</code></p>
  
  <p>I think crypto is actually an object defined in aws-sdk/lib/util.js, which is required by aws-sdk/lib/region_config.js.</p>