I am currently working on developing an Angular web application with a specific theme that requires the inclusion of CSS and JS files. Majority of the JS files needed are jquery plugins, so I made sure to install them using the following commands:
npm i jquery --only=dev
npm i @types/jquery --save
In my imports section, I added the line:
import * as $ from 'jquery';
Below is the dependencies section in my package.json file:
"dependencies": {
"@angular/animations": "~8.2.3",
"@angular/common": "~8.2.3",
"@angular/compiler": "~8.2.3",
"@angular/core": "~8.2.3",
"@angular/forms": "~8.2.3",
"@angular/platform-browser": "~8.2.3",
"@angular/platform-browser-dynamic": "~8.2.3",
"@angular/router": "~8.2.3",
"@types/jquery": "^3.3.31",
"jquery": "^3.4.1",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
The main issue I'm facing is this error message:
ERROR in error TS2688: Cannot find type definition file for 'jquery'.
Despite installing both packages and even trying out suggestions such as removing the @types/jquery line from dependencies, none of the solutions seem to work. Can someone shed light on the TS2688 error code? I also looked through this thread for guidance: Angular 8 Using Jquery
If you can provide any insights or spot where I might be going wrong, I would greatly appreciate it. Apologies if my question sounds too basic. Your help with this matter is valuable,
Thank you,