首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cdk synth:找不到模块

cdk synth:找不到模块
EN

Stack Overflow用户
提问于 2022-05-07 21:24:13
回答 1查看 310关注 0票数 0

我将从相对路径导入切换到我的CDK包的绝对路径导入,并在运行cdk synth时获得此错误

代码语言:javascript
复制
$ cdk synth
Error: Cannot find module 'lib/CodePipelineStack'

我按照这个using absolute paths in typescript for importstsconfig.json文件中设置了baseUrlpaths

不知道为什么不起作用。

更多语境

我的项目结构如下:

我的tsconfig.json是:

代码语言:javascript
复制
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "bin/*": [ "./bin/*" ],
      "lib/*": [ "./lib/*" ],
      "test/*": [ "./test/*" ]
    },
    "target": "ES2018",
    "module": "commonjs",
    "lib": [
      "es2018"
    ],
    "declaration": true,
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": false,
    "inlineSourceMap": true,
    "inlineSources": true,
    "experimentalDecorators": true,
    "strictPropertyInitialization": false,
    "typeRoots": [
      "./node_modules/@types"
    ]
  },
  "exclude": [
    "node_modules",
    "cdk.out"
  ]
}

我试过"baseUrl": "./""baseUrl": ".",两者都不起作用。

EN

回答 1

Stack Overflow用户

发布于 2022-10-13 17:01:18

对于windows /不起作用。你可以用"sh ./.“或者使用反斜杠\

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72156462

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档