我正在尝试使用Yarn 2构建一个nodejs应用程序,其中包括:
"build": "rimraf ./dist && tsc"
但我得到了:
.yarn/cache/winston-transport-npm-4.4.0-e1b3134c1e-16050844d2.zip/node_modules/winston-transport/index.d.ts:9:26 - error TS2307: Cannot find module 'logform' or its corresponding type declarations. 9 import * as logform from 'logform';
即使有了这条消息,程序仍然运行正常。在dev中,终端中没有错误。
打字本: 3.9.7
纱线: 2.4.1
节点: 12.19.0
温斯顿: 3.3.3
nodeLinker: pnp
发布于 2021-12-11 08:04:21
温斯顿开发人员似乎忘记在devDependencies中安装logform类型,所以只需运行以下命令
yarn add @types/logform --dev
在你的项目中,每件事情都会像预期的那样工作。
https://stackoverflow.com/questions/67623520
复制相似问题