tsconfig.app.json

问题描述 投票:0回答:2

我第一次尝试将 Angular-cli 6 通用应用程序部署到 App Engine。我收到错误:

ENOENT: no such file or directory, stat '/app/src/tsconfig.app.json'

我在构建或测试该应用程序时没有任何问题。是什么决定了路径?我查看了迁移指南,其中描述了从 angular-cli.json 到 angular.json 的更改,但我找不到解决方案。

tsconfig.json(项目根文件夹)

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

tsconfig.app.json(在根目录下的 /src 中)

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "module": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "types": [
      "jasmine", "node"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts"
  ]
}

angular.json 有这个参考

"tsConfig": "src/tsconfig.spec.json"
ios angular google-app-engine angular-universal
2个回答
1
投票

我找到了解决方案。我排除了 app.yaml 中一些我不应该排除的文件。


0
投票

如果未找到

tsconfig.app.json
,您可以使用命令
ng version
:

检查本地 CLI

如果您的全局 Angular CLI 版本高于本地版本,请使用以下命令安装全局 Angular CLI 版本:

npm i @angular/[email protected]
。您可以在此链接中检查正确的命令:https://www.npmjs.com/package/@angular/cli?activeTab=versions .

© www.soinside.com 2019 - 2024. All rights reserved.