Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eslint error : Cannot find any-observable implementation nor global.Observable

I've installed latest "rxjs": "6.2.2", and "redux-observable": "1.0.0",.

I have precommit hook that does eslint checks.

After installation is started to throw this error:

C:\XXX\node_modules\any-observable\register.js:29
                throw new Error('Cannot find any-observable implementation nor' +
                ^

Error: Cannot find any-observable implementation nor
global.Observable. You must install polyfill or call
require("any-observable/register") with your preferred implementation,
e.g. require("any-observable/register")('rxjs') on application load
prior to any require("any-observable").
    at loadImplementation (C:\XXX\node_modules\any-observable\register.js:29:9)
    at register (C:\XXX\node_modules\any-observable\loader.js:32:18)
    at Object.<anonymous> (C:\XXX\node_modules\any-observable\index.js:2:39)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)

husky > pre-commit hook failed (add --no-verify to bypass)

How can I fix it? 
Why eslint is doing stuff with files in `node_modules` anyway?
like image 744
dragonfly Avatar asked Aug 20 '18 09:08

dragonfly


1 Answers

I had a similar issue. I deleted the package-lock.json and the node-modules folder, run npm install and everything was fixed.

like image 183
andresmechali Avatar answered Sep 22 '22 17:09

andresmechali