[英]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.