Hey, I'm trying to create a new project, but when running
tsc
tsc
to build the bot I get many errors.
node_modules/@sapphire/result/dist/cjs/index.d.cts:832:5 - error TS2416: Property 'isOkAnd' in type 'ResultOk<T>' is not assignable to the same property in base type 'IResult<T, any>'. Type '<R extends boolean>(cb: (value: T) => R) => R' is not assignable to type '<R extends boolean>(cb: (value: T) => R) => this is ResultOk<T> & R'. Signature '(cb: (value: T) => R): R' must be a type predicate.832 isOkAnd<R extends boolean>(cb: (value: T) => R): R;
node_modules/@sapphire/result/dist/cjs/index.d.cts:832:5 - error TS2416: Property 'isOkAnd' in type 'ResultOk<T>' is not assignable to the same property in base type 'IResult<T, any>'. Type '<R extends boolean>(cb: (value: T) => R) => R' is not assignable to type '<R extends boolean>(cb: (value: T) => R) => this is ResultOk<T> & R'. Signature '(cb: (value: T) => R): R' must be a type predicate.832 isOkAnd<R extends boolean>(cb: (value: T) => R): R;
There are more errors in this file from similar methods (isErr, isErrAnd, isNone, ...)
And also some errors between
@types/node
@types/node
and
discord.js
discord.js
.
node_modules/@types/node/events.d.ts:503:30 - error TS2300: Duplicate identifier 'EventEmitter'.503 export { internal as EventEmitter }; ~~~~~~~~~~~~ node_modules/discord.js/typings/index.d.ts:246:9 246 class EventEmitter { ~~~~~~~~~~~~ 'EventEmitter' was also declared here.
node_modules/@types/node/events.d.ts:503:30 - error TS2300: Duplicate identifier 'EventEmitter'.503 export { internal as EventEmitter }; ~~~~~~~~~~~~ node_modules/discord.js/typings/index.d.ts:246:9 246 class EventEmitter { ~~~~~~~~~~~~ 'EventEmitter' was also declared here.
And similar ones
I thought maybe me dependencies do not match or so, but I tried using other versions too and didn't notice anything different Here are my deps