Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn Cannot find module 'logform' winston in build

i'm trying to build with Yarn 2 one nodejs application with:

"build": "rimraf ./dist && tsc"

but i'm getting:

.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';

Even with this message the program still runs correctly. In dev no errors are logged in terminal.

typescript: 3.9.7

Yarn: 2.4.1

Node: 12.19.0

winston: 3.3.3

nodeLinker: pnp

like image 987
Wesley de Faria Cazelli Avatar asked Jan 23 '26 17:01

Wesley de Faria Cazelli


1 Answers

it seems that the Winston developers forgot to install the logform types in the devDependencies so all you need is to run the following command

yarn add @types/logform --dev 

in your project and every thing will work as expected.

like image 99
Muhammed Paqer Avatar answered Jan 25 '26 11:01

Muhammed Paqer