AWS代码构建错误:lib/lambda-Stacks/cognito-triggers-Stack.ts(4,28): error TS2307: Cannot find module '../../src/types/types' or its corresponding type declarations.
期望结果:对于代码构建成功构建CDK项目和更新云形成堆栈。
CDK Pipeline Configuration:
this.codePipeline = new CodePipeline(this, `${environment}-pipeline-${appName}`, {
pipelineName: `${environment}-pipeline-${appName}`,
selfMutation: true,
crossAccountKeys: false,
role: this.codePipelineRole,
synth: new ShellStep("Deployment", {
input: CodePipelineSource.codeCommit(this.codeRepository, environment),
installCommands: ["npm i -g npm@latest", "npm install -g aws-cdk"],
commands: ["cd backend", "npm ci", "npm run build", "npx cdk synth"],
primaryOutputDirectory: "backend/cdk.out",
}),
});
找到这篇文章后,我将.d.ts
扩展名更改为.ts
,以获得最简单的解决方案。