typescript Node_modules/rxjs/Rx"' 没有导出成员 'Rx'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45272627/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 04:45:12  来源:igfitidea点击:

Node_modules/rxjs/Rx"' has no exported member 'Rx'

angulartypescriptvisual-studio-coderxjsobservable

提问by Sampath

Can you tell me why below behavior with rxjs/Rx? I'm using VS code V 1.14.1.

你能告诉我为什么下面的行为rxjs/Rx吗?我正在使用VS code V 1.14.1.

This works:

这有效:

import * as Rx from 'rxjs/Rx';

and

import Rx from 'rxjs/Rx';

ButThis is not working.

但这是行不通的。

import { Rx } from 'rxjs/Rx';

node_modules/rxjs/Rx"' has no exported member 'Rx'.

node_modules/rxjs/Rx"' 没有导出成员 'Rx'。

回答by T. Shashwat

its rxjs issue , i fixed it using npm install rxjs-compat

它的 rxjs 问题,我使用npm install rxjs-compat修复了它

回答by RAHULRSANNIDHI

try with this:

试试这个:

import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';

从'rxjs/internal/BehaviorSubject'导入{BehaviorSubject};

回答by basarat

node_modules/rxjs/Rx"' has no exported member 'Rx'.

node_modules/rxjs/Rx"' 没有导出成员 'Rx'。

Because it doesn't have an exported member named Rx.

因为它没有名为Rx.

More

更多的

You cannot importsomething that isn't exported.

你不能import做一些不是exported 的事情。

回答by sudheer nunna

npm install @reactivex/rxjs

import * as Rx from 'rxjs';

回答by Geek

I encountered the same issue . This seems to be the problem because they are using version of RxJs which you might not be using.

我遇到了同样的问题。这似乎是问题所在,因为他们正在使用您可能没有使用的 RxJs 版本。

I will suggest to just downgrade angular flex to 5.0.0-beta.14.

我建议将 angular flex 降级到 5.0.0-beta.14。

reference : https://github.com/angular/flex-layout/issues/702

参考:https: //github.com/angular/flex-layout/issues/702

回答by Shalini

I had this issue recently. Fixed it using below steps

我最近有这个问题。使用以下步骤修复它

remove node_modules using rm -rf node_modules/

使用rm -rf node_modules/删除 node_modules

set rxjs v6.0.0, rxjs-compat v6.0.0 in package.json

package.json 中设置 rxjs v6.0.0、rxjs-compat v6.0.0

run npm install

运行npm 安装

run ionic serve

运行离子服务

回答by Mwiza

Note: Rxjsdoes not have or export Rx

注意Rxjs没有或导出Rx

so Import {Rx} from 'rxjs'will not work

所以Import {Rx} from 'rxjs'不会工作

If you want to import something specific like an Observable, you can do:

如果你想导入一些特定的东西,比如 Observable,你可以这样做:

import { Observable } from 'rxjs';

Alternatively, you can import entire Rxjsand give it an alias of Rxas follows:

或者,您可以导入整个Rxjs并为其指定Rx的别名,如下所示:

Import * as Rx from 'rxjs'

Import * as Rx from 'rxjs'