title: error TS2304: Cannot find name 'Element' when deploy cloud functions firebase
body: <p>I'm building an Angular + Firebase web app and due to some complex queries I started looking for Cloud Functions from firebase.</p>
  
  <p>My project looks like:</p>
  
  <pre><code>MyProject
     |__ node_modules
     |__ src (with app and my complete project)
     |__ some files like tsconfig.json
  </code></pre>
  
  <p>I followed the classic tutorial: <a href="https://firebase.google.com/docs/functions/get-started" rel="nofollow noreferrer">https://firebase.google.com/docs/functions/get-started</a></p>
  
  <pre><code>MyProject
     |__ node_modules
     |__ src (with app and my complete project)
     |__ some files like tsconfig.json
     |__ functions
             |__ node_modules
             |__ src
  </code></pre>
  
  <p>But problem when using firebase deploy --only functions:</p>
  
  <pre><code>i  deploying functions
  Running command: npm --prefix "%RESOURCE_DIR%" run lint
  
  &gt; functions@ lint E:\Travail\wamp64\www\WhoAmI\WhoAmI\functions
  &gt; tslint --project tsconfig.json
  
  Running command: npm --prefix "%RESOURCE_DIR%" run build
  
  &gt; functions@ build E:\Travail\wamp64\www\WhoAmI\WhoAmI\functions
  &gt; tsc
  
  ../node_modules/@types/jquery/index.d.ts(191,29): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(512,41): error TS2304: Cannot find name 'Event'.
  ../node_modules/@types/jquery/index.d.ts(517,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(527,21): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(552,20): error TS2304: Cannot find name 'Event'.
  ../node_modules/@types/jquery/index.d.ts(562,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(582,13): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(944,34): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(952,15): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(960,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(999,36): error TS2304: Cannot find name 'Document'.
  ../node_modules/@types/jquery/index.d.ts(1046,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1054,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1061,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1070,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1078,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1087,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1096,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1105,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1114,25): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1191,25): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1191,45): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1309,32): error TS2304: Cannot find name 'Window'.
  ../node_modules/@types/jquery/index.d.ts(1316,20): error TS2304: Cannot find name 'Node'.
  ../node_modules/@types/jquery/index.d.ts(1378,29): error TS2304: Cannot find name 'XMLDocument'.
  ../node_modules/@types/jquery/index.d.ts(1402,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1412,39): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(1422,39): error TS2304: Cannot find name 'Document'.
  ../node_modules/@types/jquery/index.d.ts(1437,70): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(1472,69): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(1482,115): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(3075,14): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3119,34): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3119,42): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3119,59): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3126,57): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3135,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3135,43): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3135,60): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3142,58): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3150,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3159,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3159,43): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3159,60): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3166,58): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3197,38): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3197,46): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3205,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3205,47): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3214,36): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3214,44): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3214,61): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3221,59): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3229,36): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3245,37): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3253,42): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3253,50): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3260,29): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3287,16): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3301,34): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3316,37): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3331,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3346,38): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3354,25): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3360,12): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3373,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3386,22): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3395,37): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3402,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3440,41): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3454,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3463,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3498,43): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3505,21): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3527,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3555,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3570,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3598,47): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3631,25): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3654,40): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3661,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3661,27): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3707,28): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3748,25): error TS2304: Cannot find name 'Element'.
  npm ERR! code ELIFECYCLE
  npm ERR! errno 2
  npm ERR! functions@ build: `tsc`
  npm ERR! Exit status 2
  npm ERR!
  npm ERR! Failed at the functions@ build script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  </code></pre>
  
  <p>Any idea ? Did I do something wrong ?</p>
  
  <p>Versions:
  "firebase": "^5.0.4"
  "firebase-functions": "^2.0.3"
  "firebase-admin": "~6.0.0"
  firebase CLI: 4.2.1</p>