RTm*_*man 31 angular npm-audit angular10
我今天运行了这个较旧的 10.0.1 angular 项目,它告诉我它有很多低漏洞和一些高漏洞。所以我运行 npm audit fix 来修复它们。但是现在当我尝试运行它时,它给了我这些错误:
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)
Run Code Online (Sandbox Code Playgroud)
任何想法如何解决这一问题?我真的在网上找不到任何相关的问题或解决方案。
小智 44
将 Angular CLI 从 10 升级到 11 对我有用。
ng update @angular/core @angular/cli
ng update
Run Code Online (Sandbox Code Playgroud)
小智 6
试试这个
rm -rf node_modules/
npm install
npm run build
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
26093 次 |
最近记录: |