模块构建失败:错误:TypeScript编译中缺少index.ts [英] Module build failed: Error: index.ts is missing from the TypeScript compilation
问题描述
项目说明:我的项目正在通过package.json下载到node_module
Description of the project: My project is downloading to node_module via package.json
Package.json
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",
}
....
执行"npm构建"时出现错误:
Gotting error when doing "npm build":
./node_modules/@myllc/application-core/index.ts模块中的ERROR 构建失败:错误: TypeScript编译中缺少/var/www/frontend-skeleton/node_modules/@myllc/application-core/index.ts.请确保它在 您的tsconfig通过文件"或包含"属性.丢失的文件 似乎是第三方图书馆的一部分. TS文件已发布 库通常是库包装不良的标志.请打开 库存储库中的问题,以警告其作者并请他们 使用Angular Package Form将库打包 (
https:// goo.gl/jB3GVv
).
ERROR in ./node_modules/@myllc/application-core/index.ts Module build failed: Error: /var/www/frontend-skeleton/node_modules/@myllc/application-core/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Form at (
https:// goo.gl/jB3GVv
).
从Angular4升级到Angular5后出现: tsconfig:
This appear after upgrade from Angular4 to 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"
]
}
}
我尝试添加
"include": [
"./node_modules/@myllc/**/*"
]
,但是在更深的.ts文件夹中出现相同的错误.也成立 https://github.com/angular/angular-cli/issues/8284 但没有任何方法可以解决此错误.
but there appear same error at deeper folder .ts file. Also founding https://github.com/angular/angular-cli/issues/8284 but nothing solved this error.
解决方案是什么?