我运行时遇到问题tsc
error TS5055: Cannot write file 'index.d.ts' because it would overwrite input file.
my tsconfig.json
:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"newLine": "LF",
"preserveConstEnums": true,
"pretty": true,
"experimentalDecorators": true
},
"exclude": [
"node_modules",
"typings"
]
}
此问题在以下情况下得到解决:
- exclude
index.ts
in tsconfig
- run
tsc index.ts
- Turn
declaration
off in tsconfig
- rename
index
以另一个名字!
更改 package.json 中的打字稿主文件时,我遇到同样的问题
例如:将index.ts重命名为foo.ts
change package.json
to
"typescript": {
"main": "foo.ts"
}
tsc 错误:
error TS5055: Cannot write file 'index.d.ts' because it would overwrite input file.
无论文件内容如何,任何代码内容都有相同的问题!
我能做什么来修复它?
源代码:https://github.com/AliMD/Node.js-Telegram-Bot-API/tree/v0.0.2-0 https://github.com/AliMD/Node.js-Telegram-Bot-API/tree/v0.0.2-0
先感谢您。