Answer the question
In order to leave comments, you need to log in
What if npm @types dependencies create a conflict in TypeScript?
As soon as I do npm i
, I immediately get a bunch of errors that start like this:
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts:77:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: NativeBuffer, NativeDate, NativeError, Mongoose, CastError, ConnectionBase, Connection, ValidationError, Error, VirtualType, Schema, MongooseDocument, Subdocument, Array, DocumentArray, Buffer, ObjectIdConstructor, Decimal128, Embedded, Query, DocumentQuery, mquery, Aggregate, SchemaType
77 declare module "mongoose" {
~~~~~~~
node_modules/@types/mongoose/index.d.ts:48:1
48 declare module "mongoose" {
~~~~~~~
Conflicts are in this file.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts:703:48 - error TS2314: Generic type 'HookAsyncCallback<T>' requires 1 type argument(s).
703 pre(method: string, parallel: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): this;
~~~~~~~~~~~~~~~~~
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts:704:29 - error TS2314: Generic type 'HookSyncCallback<T>' requires 1 type argument(s).
704 pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): this;
~~~~~~~~~~~~~~~~
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts:766:13 - error TS2428: All declarations of 'HookSyncCallback' must have identical type parameters.
766 interface HookSyncCallback {
~~~~~~~~~~~~~~~~
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts:770:13 - error TS2428: All declarations of 'HookAsyncCallback' must have identical type parameters.
770 interface HookAsyncCallback {
~~~~~~~~~~~~~~~~~
node_modules/@types/mongoose/index.d.ts:48:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: NativeBuffer, NativeDate, NativeError, Mongoose, CastError, ConnectionBase, Connection, ValidationError, Error, VirtualType, Schema, MongooseDocument, Subdocument, Array, DocumentArray, Buffer, ObjectIdConstructor, Decimal128, Embedded, Query, DocumentQuery, mquery, Aggregate, SchemaType
48 declare module "mongoose" {
~~~~~~~
/node_modules/@types/connect-mongo/node_modules/@types
how everything works great. How to solve this problem correctly? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question