edwardanthony / nestjs-seeder

An extension library for NestJS to perform seeding.
MIT License
102 stars 21 forks source link

Cannot find namespace 'Faker'. #19

Closed LarsFlieger closed 2 years ago

LarsFlieger commented 3 years ago

I implemented the example from the README.md and get this error:

node_modules/nestjs-seeder/dist/decorators/factory.decorator.d.ts:2:23 - error TS2688: Cannot find type definition file for 'faker'.
2 /// <reference types="faker" />
node_modules/nestjs-seeder/dist/decorators/factory.decorator.d.ts:5:54 - error TS2503: Cannot find namespace 'Faker'.
5 export declare type FactoryValueGenerator = (faker?: Faker.FakerStatic, ctx?: Record<string, any>) => FactoryValue;
arashsheyda commented 3 years ago

i had the same issue, so i went and edit factory.decorator.d.ts manually, if anyone finds a better way glad to hear it

edwardanthony commented 3 years ago

Have you installed the type definition for faker? npm install --save @types/faker

Faker is a different library. So make sure you install its type definition.

arashsheyda commented 3 years ago

yeah i realized that after i removed it it works thank you 👍