[英]Cannot find module 'faker' or its corresponding type declarations.(2307)
I was trying to use 'faker' with TypeScript in TestCafe Studio.我试图在 TestCafe Studio 中将“faker”与 TypeScript 一起使用。 But I'm getting an error saying Cannot find module 'faker' or its corresponding type declarations.(2307)但是我收到一条错误消息,提示找不到模块“faker”或其相应的类型声明。(2307)
import * as faker from 'faker';
This is what I have tried in TestCafe.这是我在 TestCafe 中尝试过的。
The faker package has been discontinued. faker package已经停产。
To resolve this, try doing the following:要解决此问题,请尝试执行以下操作:
npm install @faker-js/faker --save-dev
# or yarn
yarn add @faker-js/faker -D
You can override the import to:您可以将导入覆盖为:
import faker from "@faker-js/faker";
Documentation @faker-js/faker文档@faker-js/faker
Faker package is discontinued and may not be used anymore. Faker package 已停产,可能不再使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.