小编use*_*630的帖子

模块构建失败:错误:TypeScript编译中缺少index.ts.

项目描述:我的项目是通过package.json下载到node_module

的package.json

....
   dependencies:{
       ....
       "@myllc/application-core": "git+ssh://git@bitbucket.org/myllc/application-core.git",
       "@myllc/application-shared":"git+ssh://git@bitbucket.org/myllc/application-shared.git",

   }
   ....
Run Code Online (Sandbox Code Playgroud)

在执行"npm build"时出错:

./node_modules/@myllc/application-core/index.ts中的错误.模块构建失败:错误:TypeScript编译中缺少/var/www/frontend-skeleton/node_modules/@myllc/application-core/index.ts.请通过'files'或'include'属性确保它在您的tsconfig中.丢失的文件似乎是第三方库的一部分.已发布库中的TS文件通常是包装严重的库的标志.请在库存储库中打开一个问题,提醒其作者并要求他们使用Angular Package Form(https:// goo.gl/jB3GVv)打包库.

从Angular4升级到Angular5后出现:Tsconfig:

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

  }

}
Run Code Online (Sandbox Code Playgroud)

我试着补充一下

"include": [
    "./node_modules/@myllc/**/*"
  ]
Run Code Online (Sandbox Code Playgroud)

但在更深的文件夹.ts文件中出现相同的错误.还创建了 https://github.com/angular/angular-cli/issues/8284, 但没有解决这个错误.

解决办法是什么?

angular5

6
推荐指数
1
解决办法
8937
查看次数

标签 统计

angular5 ×1