【问题标题】:Angular App not building after npm remove material-design-iconsnpm remove material-design-icons 后 Angular App 未构建
【发布时间】:2021-10-31 22:38:32
【问题描述】:

我们有一个 Angular 应用程序,其中包含一些我正在尝试更新的过时依赖项。我想直接使用 fonts.googleapis.com 将 Material Icon 字体包含在内,但在卸载“material-design-icons”包后,该应用程序无法构建。 运行 ng serve 时出现此错误:

An unhandled exception occurred: ENOENT: no such file or directory, lstat 'C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\material-design-icons'
See "C:\Users\mstein\AppData\Local\Temp\ng-gf4InK\angular-errors.log" for further details.

日志文件说:

[error] Error: ENOENT: no such file or directory, lstat 'C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\material-design-icons'
    at Object.realpathSync (fs.js:1529:7)
    at C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:44:35
    at Array.forEach (<anonymous>)
    at Object.getStylesConfig (C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:35:76)
    at C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:91:23
    at generateWebpackConfig (C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:45:49)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async generateBrowserWebpackConfigFromContext (C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:136:20)
    at async Object.generateI18nBrowserWebpackConfigFromContext (C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:77:20)
    at async setup (C:\Projekte\JI.Infopool\JI.Infopool.WebApp\ClientApp\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:87:47)

我不知道问题出在哪里,我的项目中没有对该包的任何引用。有什么建议吗?

【问题讨论】:

    标签: angular angular-material material-design-icons


    【解决方案1】:

    请从您的项目中删除 node_modules 并重新安装依赖项。 它应该可以解决问题。

    【讨论】:

    • 您可以使用npm ci 命令来做到这一点。
    猜你喜欢
    • 2018-11-14
    • 1970-01-01
    • 2021-10-12
    • 1970-01-01
    • 1970-01-01
    • 2015-01-09
    • 1970-01-01
    • 2016-09-20
    • 1970-01-01
    相关资源
    最近更新 更多