title: How to include Laravel Echo in Angular 6 Project?
body: <p>I've been banging my head against the wall with this one.  I can't seem to figure out how to include Laravel Echo in my Angular 6 project so I can use it from within my components.</p>
  
  <p>I run <code>npm install laravel-echo</code>, works no problem.</p>
  
  <p>I noticed when I try to do:</p>
  
  <pre><code>import { Echo } from 'laravel-echo';
  </code></pre>
  
  <p>I get this:</p>
  
  <blockquote>
    <p>Uncaught Error: Unexpected value 'undefined' imported by the module 'AppModule'</p>
  </blockquote>
  
  <p>I tried referencing the file in the node_modules folder:</p>
  
  <pre><code>import { Echo } from 'node_modules/laravel-echo/src/echo';
  </code></pre>
  
  <p>but got this:</p>
  
  <blockquote>
    <p>ERROR in node_modules/laravel-echo/src/connector/pusher-connector.ts(30,27): error TS2304: Cannot find name 'Pusher'.</p>
  </blockquote>
  
  <p>along with a list of many other missing dependencies. followed by: </p>
  
  <blockquote>
    <p>The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format</p>
  </blockquote>
  
  <p>So, I tried adding it to my <code>angular.json</code> file:</p>
  
  <pre><code>"scripts": [
      "node_modules/laravel-echo/dist/echo.js"
  ]
  </code></pre>
  
  <p>And it loads in the project, but I get this error:</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: module is not defined
       at echo.js:933</p>
  </blockquote>
  
  <p>I noticed the file structure of the package looks like maybe it's made to be able to be imported like other modules:</p>
  
  <p><a href="https://i.stack.imgur.com/CoB9J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CoB9J.png" alt="enter image description here"></a></p>
  
  <p>Obviously I have no clue what I'm doing here.  </p>
  
  <p><strong>What is the correct way to add this package to my Angular6 project?</strong></p>
  
  <p>Many Thanks!</p>