Azure Angular / Nodejs部署-退出NPM脚本“开始”,但未指示Angular CLI正在侦听请求

时间:2018-10-19 13:20:28

标签: node.js angular azure .net-core

我有一个Angular / Nodejs应用,我正尝试将其部署到Azure应用服务。

当我尝试部署我的应用程序时,收到以下错误消息:

An unhandled exception occurred while processing the request.
AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: 'npm' is not recognized as an internal or external command,

))
System.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)

我的Web应用程序服务的应用程序设置如下:

ASPNETCORE_ENVIRONMENT = Production
NODE_ENVIRONMENT = Production
WEBSITE_NODE_DEFAULT_VERSION = 8.11.3

Package.json

 {
      "name": "OidcAngularClient",
      "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"
      },

Angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "OidcAngularClient": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "../../EmployeeExpertisePlatform/wwwroot",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "progress": true,
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets"
            ],
            "styles": [
              "src/styles.css",
              "node_modules/bootstrap/dist/css/bootstrap.min.css"
            ],
            "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js"
            ]
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "OidcAngularClient:build",
            "port": 5004
          },
          "configurations": {
            "production": {
              "browserTarget": "OidcAngularClient:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "OidcAngularClient:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "karmaConfig": "./karma.conf.js",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "scripts": [],
            "styles": [
              "src/styles.css",
              "node_modules/bootstrap/dist/css/bootstrap.min.css"
            ],
            "assets": [
              "src/assets"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    },
    "OidcAngularClient-e2e": {
      "root": "",
      "sourceRoot": "e2e",
      "projectType": "application",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "./protractor.conf.js",
            "devServerTarget": "OidcAngularClient:serve"
          }
        },

在线阅读并遵循文档/教程后,我仍然继续收到相同的错误消息。有没有人有解决此问题的经验?我是Azure新手,在此方面提供的任何帮助将不胜感激。

0 个答案:

没有答案