title: How to use third party npm packages with ember cli app
body: <p><strong>EDIT:</strong> <em>this is actually about any npm package which is not designed to play along with ember. In my case, I tried to make crypto-js work, but it seems to be always the same trouble with any npm package not specially designed for ember cli.</em></p>
  
  <p>I want to use cryptoJS in my ember app, which I'm currently refactoring with ember cli, but I'm having a lot of trouble importing all the third party packages and libraries I'm already using, like for example cryptoJS.</p>
  
  <p>CryptoJS at least has a package for npm, I don't even want to think about what happens if some of my included libraries don't have a package...</p>
  
  <p>Am I just missing the point in the documentation of ember-cli or is it really not described how to import other npm packages and also how to inlcude non-package libraries properly to keep them under version control and dependency control?</p>
  
  <p>If I follow the description of the crypto-js package manual:</p>
  
  <pre><code>var CryptoJS = require("crypto-js");
  console.log(CryptoJS.HmacSHA1("Message", "Key"));
  </code></pre>
  
  <p>I get and error in my <code>ember build</code></p>
  
  <pre><code>utils/customauthorizer.js: line 1, col 16, 'require' is not defined.
  </code></pre>
  
  <p>Thanks for any help on this, I'm very excited about the ember cli project, but importing my existing ember app has been quite painful so far... </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Just importing unfortunately does not work. </p>
  
  <pre><code>import CryptoJS from 'crypto-js';
  </code></pre>
  
  <p>throws during the build</p>
  
  <pre><code>daily@dev1:~/VMD$ ember build
  version: 0.1.2
  Build failed.
  File: vmd/utils/customauthorizer.js
  ENOENT, no such file or directory '/home/daily/VMD/tmp/tree_merger-tmp_dest_dir-F7mfDQyP.tmp/crypto-js.js'
  Error: ENOENT, no such file or directory '/home/daily/VMD/tmp/tree_merger-tmp_dest_dir-F7mfDQyP.tmp/crypto-js.js'
      at Error (native)
      at Object.fs.statSync (fs.js:721:18)
      at addModule (/home/daily/VMD/node_modules/ember-cli/node_modules/broccoli-es6-concatenator/index.js:84:46)
      at addModule (/home/daily/VMD/node_modules/ember-cli/node_modules/broccoli-es6-concatenator/index.js:133:9)
      at addModule (/home/daily/VMD/node_modules/ember-cli/node_modules/broccoli-es6-concatenator/index.js:133:9)
      at /home/daily/VMD/node_modules/ember-cli/node_modules/broccoli-es6-concatenator/index.js:59:7
      at $$$internal$$tryCatch (/home/daily/VMD/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:470:16)
      at $$$internal$$invokeCallback (/home/daily/VMD/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:482:17)
      at $$$internal$$publish (/home/daily/VMD/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:453:11)
      at $$rsvp$asap$$flush (/home/daily/VMD/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1531:9)
  </code></pre>