node.js - TSC 2307 - Typescript - 在 Heroku 上部署时找不到模块
问题描述
我有一个 nodejs typescript 项目可以在我的本地机器上正常工作,但是当我部署到 heroku 或发送到 travis CI 时,它会显示这个错误。
运行 tsc 命令后:tsc 。
有什么帮助吗?
-----> Build Running build (yarn) yarn run v1.22.4 $ rm -rf ./dist $ tsc -p 。src/b-controllers/token/token.controller.ts(14,19):错误 TS2307:找不到模块 '../../d-domain/entities/token' 或其相应的类型声明。src/b-controllers/user/user.controller.ts(17,18):错误 TS2307:找不到模块 '../../d-domain/entities/user' 或其相应的类型声明。
我的 tsconfig:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./dist",
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"esModuleInterop": true,
"strict": true,
"noImplicitAny": false,
"skipLibCheck": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"allowJs": true
}
}
解决方案
推荐阅读
- c# - 一个项目中有许多 COM 对象
- regex - Golang替换任何和所有换行符
- php - Laravel 和 phpunit - 无法进行测试
- android - 无法从片段开始活动
- python - 如何从 QHBoxLayout 中的 qRadioButton 数组中获取选定的 qRadioButton
- microsoft-graph-api - 当 locationType 为默认值时,Microsoft Graph 中的更新事件 API 不保留位置名称
- r - Dplyr 根据条件汇总多列
- r - Shiny R中的箱线图
- performance - 是否可以使 Distribution.jl 和 StaticArrays.jl 一起工作?
- angular - RxJs6:OperatorFunction 与 MonoTypeOperatorFunction