我目前在 5.2 版中有一个关于 package.json 文件(“@angular/core”:“^5.2.0”)的 Angular 项目。
我无法运行 ng serve,因为我收到此错误消息:serve 命令需要在 Angular 项目中运行,但找不到项目定义。
我的问题是:我是否必须更新当前的 Angular 版本和软件包才能为这个应用程序提供服务?如果是,为什么我不能在这个配置中提供它?
任何帮助都感激不尽。
--> 包.JSON <--
{
"name": "default",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng app",
"build": "ng build && node server.js",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.5",
"@angular/cdk": "^5.2.1",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/flex-layout": "^2.0.0-beta.12",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/material": "^5.2.1",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@swimlane/ngx-datatable": "^11.1.7",
"chart.js": "^2.7.2",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"ng2-charts": "^1.6.0",
"npm": "^5.7.1",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "1.6.8",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"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": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"