I'm working on a bot for Discord using node/typescript. When I run the typescript compiler over my source code, I am getting this error:
node_modules/@types/readable-stream/index.d.ts(13,15): error TS2417: Class static side 'typeof _Readable' incorrectly extends base class static side 'typeof Readable'.
The types of 'Stream.Readable.Writable' are incompatible between these types.
Type 'typeof _Readable.Writable' is not assignable to type 'typeof import("stream").Writable'.
Types of parameters 'options' and 'opts' are incompatible.
Type 'import("stream").WritableOptions' is not assignable to type '_Readable.WritableOptions'.
Type 'WritableOptions' is not assignable to type 'WritableStateOptions'.
Types of property 'defaultEncoding' are incompatible.
Type 'string' is not assignable to type 'BufferEncoding'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! Shattered-Star@1.0.0 tsc: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the Shattered-Star@1.0.0 tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I've tried reinstalling @types/node since that seems to be the module where this is coming from, but that hasn't caused any changes. As far as I know, none of my source code is even making use of the readable-streams sub-module. In fact, removing it solves my problem - I just want to know what exactly happened. Here is my tsconfig.json in case I'm missing something there:
{
"compilerOptions": {
"target": "es6",
"outDir": "built/",
"moduleResolution": "Node"
},
"include": [
"./bot/**/*"
]
}
I would appreciate any help on this. Hopefully I'm not the only person who's bumped into this situation. Thanks!