any-observable You must install polyfill or call require("any-observable/register") with your prefer

之前由于在外办公,开发的项目上传gitlab,今天将项目拉取到本地运行,也没有问题,但是在提交代码时,报了一堆错如下:(xxx代替项目)

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)

通过相关资料查询,有的建议安装npm install rxjs-compat,但是安装后仍然报错,别的说法是重新安装npm包
最后发现公司由于网络限制,yarn install安装npm包时,导致相关包丢失,所以选择了cnpm install安装,最后测试通过(菜得坑,在用别的镜像下载安装时,记得把之前安装的包删掉)

你可能感兴趣的:(React,react)