我正在使用 AngularMaterial 和 FlexLayout 在 Angular 中实现示例应用程序。
我已经成功安装并实现了Angular Material Components。我还使用以下命令安装了Flex
npm install @angular/flex-layout --save
但是当我运行我的应用程序时,我在Eclipse Terminal中收到以下警告消息,如下所示
而且我的控制台中也出现以下错误。
下面显示的是package.json
文件
{
"name": "angular-material-demo",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/cdk": "^5.0.3",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/flex-layout": "^6.0.0-beta.16",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.0.3",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@types/jwt-decode": "^2.2.1",
"core-js": "^2.4.1",
"font-awesome": "^4.6.3",
"hammerjs": "^2.0.8",
"jwt-decode": "^2.2.0",
"primeng": "^2.0.5",
"rxjs": "^5.5.2",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.6.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"angular-ide": "^0.9.38",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
我也尝试执行以下步骤。
Edited package.json: Had to change my version for @angular/compiler-cli. In my case I had to bring it back to 5.2.0, as it somehow got to 5.2.10.
Deleted the node_modules directory.
Ran: npm install
Installed: npm install @angular/flex-layout.
但是我又遇到了不同的错误。我还尝试将package.json文件中的flex版本从"@angular/flex-layout": "^6.0.0-beta.16"
更改为"@angular/flex-layout": "^2.0.0-beta.12"
,但是仍然出现这些错误。
有人可以帮我解决这个问题吗?