项目描述:我的项目是通过package.json下载到node_module
包.json
....
dependencies:{
....
"@myllc/application-core": "git+ssh://[email protected] /cdn-cgi/l/email-protection/myllc/application-core.git",
"@myllc/application-shared":"git+ssh://[email protected] /cdn-cgi/l/email-protection/myllc/application-shared.git",
}
....
执行“npm build”时出现错误:
./node_modules/@myllc/application-core/index.ts 模块中出现错误
构建失败:错误:
TypeScript 编译中缺少 /var/www/frontend-sculpture/node_modules/@myllc/application-core/index.ts 。请确保它位于
您的 tsconfig 通过 'files' 或 'include' 属性。丢失的文件
似乎是第三方库的一部分。已发布的 TS 文件
库通常是打包不当的库的标志。请打开一个
图书馆存储库中的问题以提醒其作者并要求他们
使用 Angular Package Form 打包该库:
(https:// goo.gl/jB3GVv
).
从 Angular4 升级到 Angular5 后会出现以下情况:
TS配置:
{
"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 https://github.com/angular/angular-cli/issues/8284但没有解决这个错误。
解决办法是什么?