I ran this older 10.0.1 angular project today, and it told me it had a lot of low vulnerabilities and a few high ones. so i ran npm audit fix to fix them. but now when I try to run it, it gives me these errors:
Error: ./src/main.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: angularCompiler.getResourceDependencies(...) is not a function or its return value is not iterable
at getDependencies (C:\Web\vgc\vgc\node_modules\@ngtools\webpack\src\ivy\plugin.js:261:56)
at C:\Web\vgc\vgc\node_modules\@ngtools\webpack\src\ivy\plugin.js:374:20
at analyzingFileEmitter (C:\Web\vgc\vgc\node_modules\@ngtools\webpack\src\ivy\plugin.js:307:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
Error: ./src/polyfills.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: angularCompiler.getResourceDependencies(...) is not a function or its return value is not iterable
at getDependencies (C:\Web\vgc\vgc\node_modules\@ngtools\webpack\src\ivy\plugin.js:261:56)
at C:\Web\vgc\vgc\node_modules\@ngtools\webpack\src\ivy\plugin.js:374:20
at analyzingFileEmitter (C:\Web\vgc\vgc\node_modules\@ngtools\webpack\src\ivy\plugin.js:307:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
Any ideas how to fix this? I couldn't really find any relatable problems or solutions online.
Just revert the commit (or reset if you didn't commit it) and run npm ci again? If you have checked out your files from git or downloaded your project, you just need to revert package-lock. json to the previous state. Run npm install and you're good to go.
If no security vulnerabilities are found, this means that packages with known vulnerabilities were not found in your package dependency tree. Since the advisory database can be updated at any time, we recommend regularly running npm audit manually, or adding npm audit to your continuous integration process.
Upgrading the Angular CLI from 10 to 11 works for me.
ng update @angular/core @angular/cli
ng update
TRY this one
rm -rf node_modules/
npm install
npm run build
I have also fixed the same issue. The main reason was the "@angular-devkit/build-angular" version which is not matching in my case. I changed it's version compatible angular version. In my case I am using angular 10 and previously the version started with "0.11" and I changed it to "0.1002.3".
Try this:
rmdir /s node_modules
npm install "or" npm install @angular-devkit/build-angular
npm run build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With