I have just joined the angular community, and currently am working on a certain project, which has been going smoothly until I ran into a problems running jQuery, and after some research, some people suggested that I import jQuery into polyfills.ts as:
import * as jQuery from 'jquery';
window['$'] = jQuery
As a result, this showed some error suggesting I install @types/jquery. And after running:
C:\Users\Me\Apps\myProject> npm install --save-dev @types/jquery
The error/squiggly lines seem to have vanished but then it showed atleast 52 vulnerabilities. After running:
npm audit fix --force
Here seems like I have crashed everything, and every build returns a furious error as:
An unhandled exception occurred: require() of ES Module C:\Users\Me\Apps\myProject\node_modules\@angular\compiler-cli\bundles\index.js from
C:\Users\Me\Apps\myProject\node_modules\@angular-devkit\build-angular\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js not supported.
Instead change the require of index.js in C:\Users\Me\Apps\myProject\node_modules\@angular-devkit\build-angular\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js to a dynamic import() which is available in all CommonJS modules.
See "C:\Users\Me\AppData\Local\Temp\ng-pYwjGj\angular-errors.log" for further details.
I have been, since then, scurrying the web just like a spider, but I don't seem to get anything to soothe it. Any help will be handsomely acknowledged.
N.B: I am using angular CLI ~13.1.2
Regards.