Angular的新版本后出现Webpack错误



当我启动ng serve时,我总是收到下面的错误。显然,Angular 11没有任何错误。

Generating browser application bundles...Warning: Entry point '@ngbmodule/material-carousel' contains deep imports into 'C:/Users/Göbölös Márk/Desktop/Bunteto/bunteto-frontend/node_modules/@angular/compiler/src/core'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcwebpack-diagnostics.js:17
compilation.errors.push(new webpack_1.WebpackError(message));
^
TypeError: webpack_1.WebpackError is not a constructor
at Object.addError (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcwebpack-diagnostics.js:17:29)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcivydiagnostics.js:19:39
at AngularWebpackPlugin.updateAotProgram (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcivyplugin.js:342:17)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcivyplugin.js:167:24
at Hook.eval [as call] (eval at create (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHookCodeFactory.js:1:1), <anonymous>:24:1)     
at Hook.CALL_DELEGATE [as _call] (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHook.js:14:14)
at Compiler.newCompilation (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibCompiler.js:1030:30)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibCompiler.js:1073:29
at Hook.eval [as callAsync] (eval at create (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHookCodeFactory.js:1:1), <anonymous>:22:1)    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHook.js:18:14)
at Compiler.compile (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibCompiler.js:1068:28)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibWatching.js:134:19
at Hook.eval [as callAsync] (eval at create (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHookCodeFactory.js:1:1), <anonymous>:22:1)    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHook.js:18:14)
at run (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibWatching.js:88:33)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibWatching.js:83:6
C:UsersGöbölös MárkDesktopBuntetobunteto-frontend>ng serve
⠋ Generating browser application bundles...C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcwebpack-diagnostics.js:17
compilation.errors.push(new webpack_1.WebpackError(message));
^
TypeError: webpack_1.WebpackError is not a constructor
at Object.addError (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcwebpack-diagnostics.js:17:29)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcivydiagnostics.js:19:39
at AngularWebpackPlugin.updateAotProgram (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcivyplugin.js:342:17)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@ngtoolswebpacksrcivyplugin.js:167:24
at Hook.eval [as call] (eval at create (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHookCodeFactory.js:19:10), <anonymous>:24:1)   
at Hook.CALL_DELEGATE [as _call] (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHook.js:14:14)
at Compiler.newCompilation (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibCompiler.js:1030:30)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibCompiler.js:1073:29
at Hook.eval [as callAsync] (eval at create (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:22:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHook.js:18:14)
at Compiler.compile (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibCompiler.js:1068:28)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibWatching.js:134:19
at Hook.eval [as callAsync] (eval at create (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:22:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_modulestapablelibHook.js:18:14)
at run (C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibWatching.js:88:33)
at C:UsersGöbölös MárkDesktopBuntetobunteto-frontendnode_modules@angular-devkitbuild-angularnode_moduleswebpacklibWatching.js:83:6

问题是:我的Angular版本只有11,而不是12。我还更新了所有的软件包(包括webpack(。

是否已将Webpack更新到版本5?因为我有这个错误,更新为修复。现在我有其他错误哈哈哈

最新更新