Angular App not building after npm remove material-design-icons

1.1k Views Asked by At

We have an Angular App with some outdated dependencies that I'm trying to update. I want to include the Material Icon font using a directly to fonts.googleapis.com, but the app doesn't build after uninstalling the package "material-design-icons". When running ng serve I get this error:

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.

The log file says:

[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)

I don't know what the problem is, there aren't any references to that package left in my project. Any suggestions?

1

There are 1 best solutions below

1
On

Please delete node_modules from your project and install dependencies again. It should fix the problem.