我不能使用ng serve用角材料运行我的项目。它给了我这个错误:
“ @ angular / compiler-cli的版本必须为2.3.1或更高。当前版本为“ 7.0.1”。”
这就是我package.json中的内容
"dependencies": {
"@agm/core": "^1.0.0-beta.0",
"@angular/animations": "^7.0.1",
"@angular/cdk": "^7.0.2",
"@angular/common": "^7.0.1",
"@angular/compiler": "^7.0.1",
"@angular/core": "^7.0.1",
"@angular/forms": "^7.0.1",
"@angular/http": "^7.0.1",
"@angular/material": "^7.0.2",
"@angular/platform-browser": "^7.0.1",
"@angular/platform-browser-dynamic": "^7.0.1",
"@angular/platform-server": "^7.0.1",
"@angular/router": "^7.0.1",
"animate.css": "^3.5.2",
"arrive": "^2.3.1",
"bootstrap": "^3.3.5",
"bootstrap-notify": "^3.1.3",
"bootstrap-select": "^1.12.2",
"bootstrap-tagsinput": "^0.7.1",
"chartist": "^0.9.4",
"chartist-plugin-zoom": "^0.4.0",
"chartjs-plugin-zoom": "^0.5.0",
"core-js": "^2.4.1",
"datatables": "1.10.12",
"datatables.net-bs": "1.10.12",
"datatables.net-responsive": "^2.1.1",
"domready": "^1.0.8",
"eonasdan-bootstrap-datetimepicker": "4.17.47",
"fullcalendar": "^3.4.0",
"googleapis": "^19.0.0",
"jasny-bootstrap": "^3.1.3",
"jquery": "^1.12.4",
"nouislider": "^9.2.0",
"rxjs": "^5.1.0",
"twitter-bootstrap-wizard": "^1.2.0",
"validate": "^3.0.1",
"web-animations-js": "^2.2.2",
"zone.js": "^0.7.6"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^7.0.1",
"@types/bootstrap": "^3.3.32",
"@types/chartist": "^0.9.34",
"@types/jasmine": "2.5.38",
"@types/jquery": "^1.10.31",
"@types/node": "^6.0.73",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "^3.1.3"
}
您能帮我解决这个问题吗?谢谢
答案 0 :(得分:0)
此问题是因为软件包中的angular-cli版本为1.0.0,因此您需要将其更新为最新版本。例如,
"devDependencies": {
"@angular/cli": "7.0.3",
"@angular/compiler-cli": "7.0.1",
"@angular/language-service": "7.0.1",
"@compodoc/compodoc": "1.1.5",
"@types/jasmine": "2.8.9",
"@types/jasminewd2": "2.0.5",
"@types/node": "8.10.30",
"codelyzer": "4.5.0",
"husky": "1.1.2",
"jasmine-core": "3.3.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "3.1.1",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.4",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.4.0",
"lint-staged": "7.3.0",
"ng-packagr": "4.4.0",
"prettier": "1.14.3",
"protractor": "5.4.1",
"stylelint": "9.6.0",
"stylelint-order": "1.0.0",
"stylelint-scss": "3.3.2",
"ts-node": "7.0.1",
"tsickle": "0.33.1",
"tslib": "1.9.3",
"tslint": "5.11.0",
"typescript": "3.1.3"
}