升级角度7后如何解决此问题:NPM脚本“开始”退出而未指示Angular CLI正在侦听请求

时间:2019-05-27 20:00:07

标签: angular-cli angular7

我已经升级了具有所有依赖关系的ANgular 7.2,并且在构建项目时遇到此错误

退出NPM脚本“开始”,但未指示Angular CLI正在侦听请求。错误输出为:serve命令需要在Angular项目中运行,但是找不到项目定义。

安装依赖项后,请确保运行

ng更新--all --force

然后我下载了最新版本 https://nodejs.org从那里安装CHANGE选项

但对我没有任何作用。

我的package.json:

{
  "name": "XXXXXXX",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build:ssr": "npm run build -- --app=ssr --output-hashing=media",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.15",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "^7.2.15",
    "@angular/compiler": "^7.2.15",
    "@angular/core": "^7.2.15",
    "@angular/forms": "^7.2.15",
    "@angular/http": "^7.2.15",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "^7.2.15",
    "@angular/platform-browser-dynamic": "^7.2.15",
    "@angular/platform-server": "^7.2.15",
    "@angular/router": "^7.2.15",
    "@nguniversal/module-map-ngfactory-loader": "^7.1.1",
    "aspnet-prerendering": "^3.0.1",
    "babel-polyfill": "^6.26.0",
    "bootstrap": "^4.3.1",
    "core-js": "^3.1.3",
    "oidc-client": "^1.7.1",
    "rxjs": "^6.5.2",
    "zone.js": "^0.9.1",
    "rxjs-compat": "^6.0.0-rc.0"
  },
  "devDependencies": {
    "@angular/cli": "^7.3.9",
    "@angular/compiler-cli": "^7.2.15",
    "@angular/language-service": "^7.2.15",
    "@types/jasmine": "^3.3.12",
    "@types/jasminewd2": "~2.0.6",
    "@types/node": "^12.0.2",
    "codelyzer": "^5.0.1",
    "jasmine-core": "^3.4.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "^2.0.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "^2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "^5.4.2",
    "rxjs-tslint": "^0.1.7",
    "ts-node": "~8.2.0",
    "tslint": "^5.16.0",
    "typescript": "^3.4.5",
    "webpack": "^4.32.2"
  },
  "optionalDependencies": {
    "node-sass": "^4.9.0"
  }
}

0 个答案:

没有答案