while working on my angular project, i can run the dev angular server.
but when i want to build my project with ng build
or ng build --configuration production
.
im getting an error
An unhandled exception occurred: ENOENT: no such file or directory, scandir
See "/private/var/folders/gz/nzcgm1c92r353586ckkkn7580000gn/T/ng-oaeUGH/angular-errors.log" for further details.
the log says:
[error] HookWebpackError: ENOENT: no such file or directory, scandir
at makeWebpackError (/project/node_modules/webpack/lib/HookWebpackError.js:48:9)
at /project/node_modules/webpack/lib/Compilation.js:3204:12
at eval (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:31:1)
at fn (/project/node_modules/webpack/lib/Compilation.js:493:17)
at _next5 (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:28:1)
at eval (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:46:1)
at fn (/project/node_modules/webpack/lib/Compilation.js:505:9)
at _next4 (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:41:1)
at eval (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:60:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
-- inner error --
Error: ENOENT: no such file or directory, scandir
at Object.readdirSync (node:fs:1525:3)
at CacheBackend.provideSync (/project/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:332:58)
at WebpackFileSystem.listPaths (/project/node_modules/license-webpack-plugin/dist/WebpackFileSystem.js:78:24)
at LicenseTextReader.readLicense (/project/node_modules/license-webpack-plugin/dist/LicenseTextReader.js:37:54)
at PluginChunkReadHandler.processModule (/project/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:71:62)
at /project/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:24:27
at WebpackInnerModuleIterator.internalCallback (/project/node_modules/license-webpack-plugin/dist/WebpackInnerModuleIterator.js:39:13)
at WebpackInnerModuleIterator.iterateModules (/project/node_modules/license-webpack-plugin/dist/WebpackInnerModuleIterator.js:21:9)
at /project/node_modules/license-webpack-plugin/dist/PluginChunkReadHandler.js:20:39
at WebpackChunkModuleIterator.iterateModules (/project/node_modules/license-webpack-plugin/dist/WebpackChunkModuleIterator.js:28:21)
from the log, i think the license-webpack-plugin causes the error.
npm ls license-webpack-plugin
gives me this:
└─┬ @angular-devkit/[email protected]
└── [email protected]
what do I have to do to solve the problem?