Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stevenKirill opened this issue Mar 15, 2024 · 5 comments

Comments

@stevenKirill
Copy link

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
Copy link
Member

I don't understand what your error is.

@jalbane
Copy link

jalbane commented Mar 22, 2024

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
Copy link

jalbane commented Mar 25, 2024

@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
Copy link
Author

@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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants