title: Firebase and ng2-ion-range-slider package conflict in Angular
body: <p>I am using Angular and Firebase (+ Cloud functions) and in my web app I also added ng2-ion-range-slider from npm to extend my UI. But what I noticed is after installing range slider I can not deploy cloud functions to firebase.</p>
  
  <p>There is an absolute bug probably about range slider but I need to handle this conflict by some workaround.</p>
  
  <p>after execution below command in /functions folder;</p>
  
  <p>firebase deploy --only functions</p>
  
  <p>I receive below error. Even uninstalling range slider from npm it still doesn't work. Something corrupts my node_module package structure but I couldn't find it..</p>
  
  <p>Here is about my tsconfig. file</p>
  
  <pre><code>{
    "compileOnSave": false,
    "compilerOptions": {
      "baseUrl": "./",
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "module": "es2015",
      "moduleResolution": "node",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "target": "es5",
      "typeRoots": [
        "node_modules/@types"
      ],
      "lib": [
        "es2017",
        "dom"
      ]
    }
  }
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>MacBook-Pro:PRO YI$ cd functions/
  MacBook-Pro:PRO :functions YI$ firebase deploy --only functions
  
  === Deploying to 'firebaseproject'...
  
  i  deploying functions
  Running command: npm --prefix "$RESOURCE_DIR" run lint
  
  &gt; functions@ lint /Users/YI/Desktop/PRO/functions
  &gt; tslint --project tsconfig.json
  
  Running command: npm --prefix "$RESOURCE_DIR" run build
  
  &gt; functions@ build /Users/YI/Desktop/PRO/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(946,34): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(954,15): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(962,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1001,36): error TS2304: Cannot find name 'Document'.
  ../node_modules/@types/jquery/index.d.ts(1048,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1056,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1063,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1072,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1080,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1089,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1098,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1107,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1116,25): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1193,25): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1193,45): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1311,32): error TS2304: Cannot find name 'Window'.
  ../node_modules/@types/jquery/index.d.ts(1318,20): error TS2304: Cannot find name 'Node'.
  ../node_modules/@types/jquery/index.d.ts(1380,29): error TS2304: Cannot find name 'XMLDocument'.
  ../node_modules/@types/jquery/index.d.ts(1404,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(1414,39): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(1424,39): error TS2304: Cannot find name 'Document'.
  ../node_modules/@types/jquery/index.d.ts(1439,70): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(1474,69): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(1484,115): error TS2304: Cannot find name 'XMLHttpRequest'.
  ../node_modules/@types/jquery/index.d.ts(3077,14): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3121,34): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3121,42): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3121,59): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3128,57): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3137,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3137,43): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3137,60): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3144,58): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3152,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3161,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3161,43): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3161,60): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3168,58): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3199,38): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3199,46): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3207,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3207,47): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3216,36): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3216,44): error TS2304: Cannot find name 'DocumentFragment'.
  ../node_modules/@types/jquery/index.d.ts(3216,61): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3223,59): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3231,36): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3247,37): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3255,42): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3255,50): error TS2304: Cannot find name 'Text'.
  ../node_modules/@types/jquery/index.d.ts(3262,29): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3289,16): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3303,34): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3318,37): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3333,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3348,38): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3356,25): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3362,12): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3375,35): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3388,22): error TS2304: Cannot find name 'HTMLElement'.
  ../node_modules/@types/jquery/index.d.ts(3397,37): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3404,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3442,41): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3456,22): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3465,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3500,43): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3507,21): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3529,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3557,20): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3572,39): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3600,47): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3633,25): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3656,40): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3663,19): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3663,27): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3709,28): error TS2304: Cannot find name 'Element'.
  ../node_modules/@types/jquery/index.d.ts(3750,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.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/YI/.npm/_logs/2018-09-19T07_21_25_454Z-debug.log
  
  Error: functions predeploy error: Command terminated with non-zero exit code2
  MacBook-Pro:functions YI$
  </code></pre>
  
  <p>***Question Updated****
  I deleted node_module folder within both main and functions folder and than run;</p>
  
  <p>sudo npm install </p>
  
  <p>but even npm install does not work properly. </p>
  
  <pre><code>    univ-MacBook-Pro:PRO YI$ sudo npm install
  
  &gt; node-sass@4.9.3 install /Users/YI/Desktop/PRO/node_modules/node-sass
  &gt; node scripts/install.js
  
  Unable to save binary /Users/YI/Desktop/PRO/node_modules/node-sass/vendor/darwin-x64-57 : { Error: EACCES: permission denied, mkdir '/Users/YI/Desktop/PRO/node_modules/node-sass/vendor'
      at Object.fs.mkdirSync (fs.js:885:18)
      at sync (/Users/YI/Desktop/PRO/node_modules/mkdirp/index.js:71:13)
      at Function.sync (/Users/YI/Desktop/PRO/node_modules/mkdirp/index.js:77:24)
      at checkAndDownloadBinary (/Users/YI/Desktop/PRO/node_modules/node-sass/scripts/install.js:114:11)
      at Object.&lt;anonymous&gt; (/Users/YI/Desktop/PRO/node_modules/node-sass/scripts/install.js:157:1)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
      at tryModuleLoad (module.js:506:12)
      at Function.Module._load (module.js:498:3)
    errno: -13,
    code: 'EACCES',
    syscall: 'mkdir',
    path: '/Users/YI/Desktop/PRO/node_modules/node-sass/vendor' }
  
  &gt; node-sass@4.9.3 postinstall /Users/YI/Desktop/PRO/node_modules/node-sass
  &gt; node scripts/build.js
  
  Building: /usr/local/bin/node /Users/YI/Desktop/PRO/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
  gyp info it worked if it ends with ok
  gyp verb cli [ '/usr/local/bin/node',
  gyp verb cli   '/Users/YI/Desktop/PRO/node_modules/node-gyp/bin/node-gyp.js',
  gyp verb cli   'rebuild',
  gyp verb cli   '--verbose',
  gyp verb cli   '--libsass_ext=',
  gyp verb cli   '--libsass_cflags=',
  gyp verb cli   '--libsass_ldflags=',
  gyp verb cli   '--libsass_library=' ]
  gyp info using node-gyp@3.8.0
  gyp info using node@8.12.0 | darwin | x64
  gyp verb command rebuild []
  gyp verb command clean []
  gyp verb clean removing "build" directory
  gyp verb command configure []
  gyp verb check python checking for Python executable "python2" in the PATH
  gyp verb `which` failed Error: not found: python2
  gyp verb `which` failed     at getNotFoundError (/Users/YI/Desktop/PRO/node_modules/which/which.js:13:12)
  gyp verb `which` failed     at F (/Users/YI/Desktop/PRO/node_modules/which/which.js:68:19)
  gyp verb `which` failed     at E (/Users/YI/Desktop/PRO/node_modules/which/which.js:80:29)
  gyp verb `which` failed     at /Users/YI/Desktop/PRO/node_modules/which/which.js:89:16
  gyp verb `which` failed     at /Users/YI/Desktop/PRO/node_modules/isexe/index.js:42:5
  gyp verb `which` failed     at /Users/YI/Desktop/PRO/node_modules/isexe/mode.js:8:5
  gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
  gyp verb `which` failed  python2 { Error: not found: python2
  gyp verb `which` failed     at getNotFoundError (/Users/YI/Desktop/PRO/node_modules/which/which.js:13:12)
  gyp verb `which` failed     at F (/Users/YI/Desktop/PRO/node_modules/which/which.js:68:19)
  gyp verb `which` failed     at E (/Users/YI/Desktop/PRO/node_modules/which/which.js:80:29)
  gyp verb `which` failed     at /Users/YI/Desktop/PRO/node_modules/which/which.js:89:16
  gyp verb `which` failed     at /Users/YI/Desktop/PRO/node_modules/isexe/index.js:42:5
  gyp verb `which` failed     at /Users/YI/Desktop/PRO/node_modules/isexe/mode.js:8:5
  gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
  gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (/Users/YI/Desktop/PRO/node_modules/which/which.js:13:12)\n    at F (/Users/YI/Desktop/PRO/node_modules/which/which.js:68:19)\n    at E (/Users/YI/Desktop/PRO/node_modules/which/which.js:80:29)\n    at /Users/YI/Desktop/PRO/node_modules/which/which.js:89:16\n    at /Users/YI/Desktop/PRO/node_modules/isexe/index.js:42:5\n    at /Users/YI/Desktop/PRO/node_modules/isexe/mode.js:8:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
  gyp verb `which` failed   code: 'ENOENT' }
  gyp verb check python checking for Python executable "python" in the PATH
  gyp verb `which` succeeded python /usr/bin/python
  gyp verb check python version `/usr/bin/python -c "import sys; print "2.7.10
  gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
  gyp verb get node dir no --target version specified, falling back to host node version: 8.12.0
  gyp verb command install [ '8.12.0' ]
  gyp verb install input version string "8.12.0"
  gyp verb install installing version: 8.12.0
  gyp verb install --ensure was passed, so won't reinstall if already installed
  gyp verb install version is already installed, need to check "installVersion"
  gyp verb got "installVersion" 9
  gyp verb needs "installVersion" 9
  gyp verb install version is good
  gyp verb get node dir target node version installed: 8.12.0
  gyp verb build dir attempting to create "build" dir: /Users/YI/Desktop/PRO/node_modules/node-sass/build
  gyp ERR! configure error 
  gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/YI/Desktop/PRO/node_modules/node-sass/build'
  gyp ERR! System Darwin 16.0.0
  gyp ERR! command "/usr/local/bin/node" "/Users/YI/Desktop/PRO/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
  gyp ERR! cwd /Users/YI/Desktop/PRO/node_modules/node-sass
  gyp ERR! node -v v8.12.0
  gyp ERR! node-gyp -v v3.8.0
  gyp ERR! not ok 
  Build failed with error code: 1
  npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.9.3 (node_modules/node-sass):
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.9.3 postinstall: `node scripts/build.js`
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
  
  audited 24244 packages in 7.67s
  found 12 vulnerabilities (9 low, 3 high)
    run `npm audit fix` to fix them, or `npm audit` for details
  </code></pre>
  
  <p>Thanks in advance.</p>