简体   繁体   English

Angular 7 CI rxjs / Operators找不到模块

[英]Angular 7 CI rxjs/Operators cannot find module

I have tried setting up CI for my angular project using Circle CI following this configuration: https://angular.io/guide/testing#configure-project-for-circle-ci 我已经尝试按照以下配置使用Circle CI为我的角度项目设置CI: https : //angular.io/guide/testing#configure-project-for-circle-ci

However, when ng test runs I get the following error: 但是,当ng test运行时,出现以下错误:

ERROR in src/app/account/login-form/login-form.component.ts(4,26): error TS2307: Cannot find module 'rxjs/Operators'.

Locally, if I delete node_modules/ and run npm install followed by npm test I don't have any issue with rxjs. 在本地,如果我删除node_modules/并先运行npm install ,再运行npm test ,则rxjs没有任何问题。

My package.json : 我的package.json

"dependencies": {
  "@angular/animations": "7.2.4",
  "@angular/common": "7.2.4",
  "@angular/compiler": "7.2.4",
  "@angular/core": "7.2.4",
  "@angular/forms": "7.2.4",
  "@angular/http": "7.2.4",
  "@angular/platform-browser": "7.2.4",
  "@angular/platform-browser-dynamic": "7.2.4",
  "@angular/platform-server": "7.2.4",
  "@angular/router": "7.2.4",
  "@ng-bootstrap/ng-bootstrap": "^4.0.2",
  "@nguniversal/module-map-ngfactory-loader": "7.1.0",
  "angularx-social-login": "^1.2.6",
  "aspnet-prerendering": "^3.0.1",
  "bootstrap": "^4.2.1",
  "core-js": "^2.5.4",
  "rxjs": "^6.4.0",
  "zone.js": "^0.8.29"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~0.13.0",
  "@angular/cli": "~7.3.0",
  "@angular/compiler-cli": "7.2.4",
  "@angular/language-service": "^7.2.4",
  "@types/jasmine": "~2.8.6",
  "@types/jasminewd2": "~2.0.3",
  "@types/node": "~8.9.4",
  "bootstrap-sass": "3.4.0",
  "codelyzer": "~4.5.0",
  "jasmine-core": "~2.99.1",
  "jasmine-spec-reporter": "~4.2.1",
  "karma": "^3.0.0",
  "karma-chrome-launcher": "~2.2.0",
  "karma-coverage-istanbul-reporter": "~1.4.2",
  "karma-jasmine": "~1.1.1",
  "karma-jasmine-html-reporter": "^0.2.2",
  "typescript": "~3.2.4"
},
"optionalDependencies": {
  "node-sass": "4.11.0",
  "protractor": "~5.4.0",
  "ts-node": "~5.0.1",
  "tslint": "~5.9.1"
}

The offending lines in login-form.component.ts : login-form.component.ts令人反感的行:

import { Subscription } from 'rxjs';
import { finalize } from 'rxjs/Operators';

I can provide any source on here that is helpful but I don't know what is relevant. 我可以在这里提供任何有用的资源,但我不知道有什么意义。

那是因为你应该从导入rxjs/operators ,而不是rxjs/Operators

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:在Ionic Angular中找不到模块“rxjs / operators” - Error: Cannot find module “rxjs/operators” in Ionic Angular 错误 TS2307:找不到模块“rxjs/Operators”Azure DevOps Angular 8 - error TS2307: Cannot find module 'rxjs/Operators' Azure DevOps Angular 8 在angular-cli中创建新项目时找不到模块'rxjs / operators' - Cannot find module 'rxjs/operators' while creating new project in angular-cli Kendo Angular 4对等依赖性未满足,并且找不到模块“ rxjs / operators / combineLatest” - Kendo Angular 4 Unmet Peer Dependency and Cannot find module “rxjs/operators/combineLatest” 找不到模块..无法使用Angular6解析模块'rxjs / operators / toPromise - Module not found ..Cannot resolve module 'rxjs/operators/toPromise with Angular6 rxjs /运算符:找不到模块 - rxjs/operators: can not find module 找不到模块“ @ angular / core”。 找不到模块“ rxjs” - Cannot find module '@angular/core'. Cannot find module 'rxjs' 我使用ionic-img-viewer来查看图像,但是它引发了找不到模块“ rxjs / operators”的错误 - i used ionic-img-viewer for viewing image but it raised Cannot find module “rxjs/operators” error 带有Angular4应用程序的RXJS突然出现问题。 '找不到operator.js' - Sudden issue with RXJS withing Angular4 application. 'Cannot find operators.js' 关于angular2-jwt的错误,找不到模块'rxjs-compat / Observable(此模块在Angular 6中不起作用) - error about angular2-jwt, Cannot find module 'rxjs-compat/Observable (this module not works in Angular 6)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM