pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.22k stars 147 forks source link

Cannot find type definition file for pino-pretty while running npm run lint #499

Open stevenKirill opened 6 months ago

stevenKirill commented 6 months ago

I run command in teamcity step ci/cd npm run lint and got this error, node version is 16.13.2, os linux rhel 8

Screenshot 2024-03-15 at 15 37 45

How can I fix this? I can't understand whats the problem?

mcollina commented 5 months ago

I don't understand what your error is.

jalbane commented 5 months ago

I'm getting the same error when I run tsc

error TS2688: Cannot find type definition file for 'pino-pretty'. The file is in the program because: Entry point for implicit type library 'pino-pretty'

jalbane commented 5 months ago

@stevenKirill what does your tsconfig file look like?

I think removing this from my tsconfig file fixed it for me.

"typeRoots": ["node_modules/pino-pretty"]

stevenKirill commented 5 months ago

@stevenKirill what does your tsconfig file look like?

I think removing this from my tsconfig file fixed it for me.

"typeRoots": ["node_modules/pino-pretty"]

This is my ts-config file { "compilerOptions": { "jsx": "react", "module": "esnext", "noImplicitAny": true, "noImplicitReturns": false, "noUnusedParameters": true, "noEmit": false, "allowJs": true, "checkJs": false, "outDir": "./build/", "preserveConstEnums": true, "removeComments": true, "sourceMap": true, "target": "es5", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "useDefineForClassFields": true, "experimentalDecorators": true, "downlevelIteration": true, "noUnusedLocals": false, "isolatedModules":true, "skipLibCheck": true, "resolveJsonModule": true, "lib": [ "dom", "dom.iterable", "esnext" ], "baseUrl": "./", "paths": { "root/*": ["./*"], "src/*": ["src/*"], "styles/*": ["src/shared/assets/styles/*"], "images/*": ["src/shared/assets/images/*"], "fonts/*": ["src/shared/assets/fonts/*"], "icons/*": ["src/shared/assets/icons/*"], "commonServices/*": ["src/shared/api/*"], "types/*": ["src/shared/types/*"], "lib/*": ["src/shared/lib/*"], "constants/*": ["src/shared/constants/*"], "pages/*": ["src/pages/*"], "svgs/*": ["src/shared/assets/svgs/*"], "mocks/*": ["src/__mocks__/*"], "ui/*": ["src/shared/ui/*"], "api/*": ["src/shared/api/*"], "shared/*": ["src/shared/*"], "app/*": ["src/app/*"], "entities/*": ["src/entities/*"], "widgets/*": ["src/widgets/*"], "features/*": ["src/features/*"] } }, "include": [ "./types", "./src" ], "exclude": [ "node_modules/", "**/node_modules/", "/**/node_modules/*", "build/" ] } I think the problem is that it can't find types in my node_modules folder for this library

mcollina commented 4 months ago

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.