Issue
I was trying to use 'faker' with TypeScript in TestCafe Studio. But I'm getting an error saying Cannot find module 'faker' or its corresponding type declarations.(2307)
import * as faker from 'faker';
This is what I have tried in TestCafe.
Solution
The faker package has been discontinued
To resolve this try doing the following:
npm
npm install @faker-js/faker --save-dev
or yarn
yarn add @faker-js/faker --dev
You can override the import to:
import faker from "@faker-js/faker";
Documentation @faker-js/faker
Answered By - Denilson Martins
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.