CodexBloom - Programming Q&A Platform

Visual Studio 2022 - scenarios 'how to find type definition' for TypeScript definitions in Angular Project

👀 Views: 68 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-08
visual-studio angular typescript TypeScript

I'm reviewing some code and I'm dealing with I'm working with an scenario in my Angular project where Visual Studio 2022 keeps throwing a 'want to find type definition for X' behavior for several TypeScript definitions, despite having the necessary dependencies installed..... I have already checked that all required packages are present in my `package.json` and that the `node_modules` folder is up-to-date. The behavior seems to occur for types related to some third-party libraries, such as `@types/lodash` and `@types/jquery`. Here's the relevant part of my `package.json`: ```json { "dependencies": { "@angular/core": "^13.0.0", "lodash": "^4.17.21", "jquery": "^3.6.0" }, "devDependencies": { "@types/lodash": "^4.14.168", "@types/jquery": "^3.5.10", "typescript": "^4.5.2" } } ``` I tried running `npm install` and even deleted the `node_modules` folder and reinstalled everything, but the scenario continues. Additionally, I've made sure to check my `tsconfig.json` file, and it looks like this: ```json { "compilerOptions": { "target": "es6", "module": "commonjs", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "include": [ "src/**/*" ] } ``` I've also tried setting the `skipLibCheck` option to `false`, but that didn't resolve the scenario. The behavior only appears when I try to build or run the project in Visual Studio, although it compiles fine when running `ng serve` from the command line. I'm not sure what else could be causing this. Any insights would be greatly appreciated! What's the best practice here? The project is a CLI tool built with Typescript. I'd be grateful for any help. How would you solve this?