我安装了一个角度模板,但我不知道这个模板的角度是哪个版本开发的, 所以这里是package.json文件的内容
{
"name": "@coreui/coreui-free-angular-admin-template",
"version": "2.0.0-beta.0",
"description": "CoreUI Free Angular 2+ Admin Template",
"author": "Łukasz Holeczek",
"homepage": "https://coreui.io/angular",
"copyright": "Copyright 2018 creativeLabs Łukasz Holeczek",
"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.2.9",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/core": "5.2.9",
"@angular/forms": "5.2.9",
"@angular/http": "5.2.9",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/router": "5.2.9",
"@coreui/angular": "^2.0.0-beta.0",
"chart.js": "2.7.2",
"core-js": "2.5.4",
"flag-icon-css": "3.0.0",
"font-awesome": "^4.7.0",
"moment": "2.22.0",
"ng2-charts": "1.6.0",
"ngx-bootstrap": "2.0.3",
"ngx-perfect-scrollbar": "5.3.5",
"rxjs": "5.5.8",
"simple-line-icons": "^2.4.1",
"ts-helpers": "1.1.2",
"zone.js": "0.8.25"
},
"devDependencies": {
"@angular/cli": "1.7.4",
"@angular/compiler-cli": "5.2.9",
"@angular/language-service": "5.2.9",
"@types/jasmine": "2.8.6",
"@types/jasminewd2": "2.0.3",
"@types/node": "9.6.2",
"codelyzer": "4.2.1",
"jasmine-core": "2.9.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.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",
"protractor": "5.3.1",
"ts-node": "4.1.0",
"tslint": "5.9.1",
"typescript": "2.7.2"
},
"engines": {
"node": ">= 8.9.4",
"npm": ">= 5.6.0"
}
}
在此模板上使用ng服务时,我收到此警告:
@angular/compiler-cli@5.2.9 requires typescript@'>=2.4.2 <2.7.0' but 2.7.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.4.2 <2.7.0'
To disable this warning run "ng set warnings.typescriptMismatch=false".
我想使用Angular5 / 4模板
PS:如果您需要其他信息,请在评论中添加,谢谢您的提前。
答案 0 :(得分:0)
根据你的package.json文件,你的应用程序使用版本5.2.9的角度。那种类型的脚本消息是因为你使用的是后一版本的打字稿而不是你正在使用的角度版本。如果你改变了这个
“typescript”:“2.7.2”
到
“typescript”:“2.6”
你会摆脱那个警告。