#Getting error while updating my nestjs project from version 9 to 10

11 messages Β· Page 1 of 1 (latest)

wise laurel
#

ERROR [ExceptionHandler] Nest can't resolve dependencies of the SchedulerMetadataAccessor (?). Please make sure that the argument Reflector at index [0] is available in the ScheduleModule context.

my package.json

"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/event-emitter": "^2.0.2",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/schedule": "^4.0.1",
"dayjs": "^1.11.10",
}

my code

import { Module } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { DbModule } from '@db/db.module';

@Module({
imports: [DbModule, ScheduleModule.forRoot()],
providers: []
})
export class JobsModule {}

hushed aspen
#

Looks like you didn’t upgrade something

#

Run npm ls @nestjs/core

wise laurel
#

oceaneering@ /home/arsl/Desktop/Oceaneering/mp-omr-athena-ui
└─┬ [email protected] -> ./apps/message-aggregator
β”œβ”€β”€ @nestjs/[email protected]
β”œβ”€β”¬ @nestjs/[email protected]
β”‚ └─┬ @nestjs/[email protected]
β”‚ └─┬ @nestjs/[email protected]
β”‚ └── @nestjs/[email protected] deduped
β”œβ”€β”¬ @nestjs/[email protected]
β”‚ └── @nestjs/[email protected] deduped
β”œβ”€β”¬ @nestjs/[email protected]
β”‚ └── @nestjs/[email protected] deduped
└─┬ @nestjs/[email protected]
└── @nestjs/[email protected] deduped

#

this is what I get it

hushed aspen
#

you got two versions of @nestjs/core
that's why

#

you must have only one

#

I'd try removing the lock file and install everything again

wise laurel
#

I did but same result

#

└─┬ [email protected] -> ./apps/message-aggregator
β”œβ”€β”€ @nestjs/[email protected]
β”œβ”€β”¬ @nestjs/[email protected]
β”‚ └─┬ @nestjs/[email protected]
β”‚ └─┬ @nestjs/[email protected]
β”‚ └── @nestjs/[email protected] deduped
β”œβ”€β”¬ @nestjs/[email protected]
β”‚ └── @nestjs/[email protected] deduped
β”œβ”€β”¬ @nestjs/[email protected]
β”‚ └── @nestjs/[email protected] deduped
└─┬ @nestjs/[email protected]
└── @nestjs/[email protected] deduped

this is what I get after deleting my lock file and running npm install and then ls command that you shared

hushed aspen
#

You’ll need to find out why you have both v9 and v10 installed