I am trying to run npm run serve but every time I got this error
node_modules/apollo-server-cloud-functions/node_modules/apollo-cache-control/dist/index.d.ts:24:9 - error TS2717: Subsequent property declarations must have the same type. Property 'cacheControl' must be of type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }', but here has type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }'.
24 cacheControl: {
~~~~~~~~~~~~
node_modules/apollo-server-cloud-functions/node_modules/apollo-server-core/src/types/graphql-upload.d.ts:4:16 - error TS2451: Cannot redeclare block-scoped variable 'GraphQLUpload'.
4 export const GraphQLUpload: GraphQLScalarType;
~~~~~~~~~~~~~
node_modules/apollo-server-core/src/types/graphql-upload.d.ts:4:16
4 export const GraphQLUpload: GraphQLScalarType;
~~~~~~~~~~~~~
'GraphQLUpload' was also declared here.
node_modules/apollo-server-cloud-functions/node_modules/apollo-server-core/src/types/graphql-upload.d.ts:21:15 - error TS2300: Duplicate identifier 'Request'.
21 export type Request = any;
~~~~~~~
node_modules/apollo-server-core/src/types/graphql-upload.d.ts:21:15
21 export type Request = any;
~~~~~~~
'Request' was also declared here.
node_modules/apollo-server-cloud-functions/node_modules/apollo-server-core/src/types/graphql-upload.d.ts:23:15 - error TS2300: Duplicate identifier 'Response'.
23 export type Response = any;
~~~~~~~~
node_modules/apollo-server-core/src/types/graphql-upload.d.ts:23:15
23 export type Response = any;
~~~~~~~~
'Response' was also declared here.
node_modules/apollo-server-core/src/types/graphql-upload.d.ts:4:16 - error TS2451: Cannot redeclare block-scoped variable 'GraphQLUpload'.
4 export const GraphQLUpload: GraphQLScalarType;
~~~~~~~~~~~~~
node_modules/apollo-server-cloud-functions/node_modules/apollo-server-core/src/types/graphql-upload.d.ts:4:16
4 export const GraphQLUpload: GraphQLScalarType;
~~~~~~~~~~~~~
'GraphQLUpload' was also declared here.
node_modules/apollo-server-core/src/types/graphql-upload.d.ts:21:15 - error TS2300: Duplicate identifier 'Request'.
21 export type Request = any;
~~~~~~~
node_modules/apollo-server-cloud-functions/node_modules/apollo-server-core/src/types/graphql-upload.d.ts:21:15
21 export type Request = any;
~~~~~~~
'Request' was also declared here.
node_modules/apollo-server-core/src/types/graphql-upload.d.ts:23:15 - error TS2300: Duplicate identifier 'Response'.
23 export type Response = any;
~~~~~~~~
node_modules/apollo-server-cloud-functions/node_modules/apollo-server-core/src/types/graphql-upload.d.ts:23:15
23 export type Response = any;
~~~~~~~~
'Response' was also declared here.
My tsconfig
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"esModuleInterop": true,
"strict": true,
"target": "es2017",
"lib": [
"esnext.asynciterable"
]
},
"compileOnSave": true,
"include": [
"src", "index.ts"
]
}
OK, I have solved.
1 - delete node_modules
2 - delete package-lock.json
3 - npm install
Most helpful comment
OK, I have solved.
1 - delete
node_modules2 - delete
package-lock.json3 -
npm install