I have a problem running 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" ] }
This issue is resolved if:
- exclude
index.ts in tsconfig - run
tsc index.ts - Turn off
declaration in tsconfig - rename
index to another name!
I have the same problem when changing typescript of the main file in package.json
for example: rename index.ts in foo.ts
change package.json to
"typescript": { "main": "foo.ts" }
Tsc error:
error TS5055: Cannot write file 'index.d.ts' because it would overwrite input file.
file contents without mater, any code contents have the same problem!
What can I do to fix this?
Source code: https://github.com/AliMD/Node.js-Telegram-Bot-API/tree/v0.0.2-0
Thank you in advance.
source share