我正在尝试使用REDUX模式构建我的下一个Angular应用,由于某种原因,我无法导入所需的库。
node_modules/@ngrx/store/src/models.d.ts(58,58)中的错误:错误TS2304:找不到名称“未知”。
node_modules/@ngrx/store/src/models.d.ts(58,82):错误TS2370:rest参数必须为数组类型。
node_modules/@ngrx/store/src/models.d.ts(59,52):错误TS2370:rest参数必须为数组类型。
node_modules/@ngrx/store/src/models.d.ts(59,73):错误TS2304:找不到名称“未知”。
package.json
{
"name": "ng6-proj",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/cdk": "^6.2.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ngrx/store": "^8.6.0",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"rxjs": "~6.2.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "~6.2.8",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.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": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
}
答案 0 :(得分:1)
存在版本不匹配的情况,如果您使用的是Angular 6,则应使用NgRx 6。 另一种方法是将Angular更新到v8。
答案 1 :(得分:0)
由于您的NgRx版本是8.6.0,因此您需要使用命令-将您的角度版本更新为8-
x1 , 300
x2 , 250
x3 , 300
y1 , 270
y2 , 250
y3 , 280
供参考,请参见以下github链接-https://github.com/ngrx/platform/issues/1867