'angular workspace : I do run the application but I getting this type of error NGCC failed
Generating browser application bundles (phase: setup)...Error: ENOENT: no such file or directory, open 'D:/Harry/client/src/src/main.ts'
at Object.openSync (node:fs:585:3)
at Module.readFileSync (node:fs:453:35)
at NodeJSFileSystem.readFile (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-CLV7JFJQ.js:333:16)
at EsmDependencyHost.recursivelyCollectDependencies (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:208:34)
at EsmDependencyHost.processFile (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:237:12)
at EsmDependencyHost.collectDependenciesInFiles (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:204:12)
at ProgramBasedEntryPointFinder.getInitialEntryPointPaths (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:855:10)
at ProgramBasedEntryPointFinder.findEntryPoints (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:814:35)
at file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1264:33
at new ClusterMaster (file:///D:/Harry/client/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1366:22)
D:\Harry\client\node_modules@ngtools\webpack\src\ngcc_processor.js:135
throw new Error(errorMessage + NGCC failed${errorMessage ? ', see above' : ''}.
);
^
Error: NGCC failed. at NgccProcessor.process (D:\Harry\client\node_modules@ngtools\webpack\src\ngcc_processor.js:135:19) at D:\Harry\client\node_modules@ngtools\webpack\src\ivy\plugin.js:147:27 at Hook.eval [as call] (eval at create (D:\Harry\client\node_modules\tapable\lib\HookCodeFactory.js:19:10), :16:1) at Hook.CALL_DELEGATE [as _call] (D:\Harry\client\node_modules\tapable\lib\Hook.js:14:14) at Compiler.newCompilation (D:\Harry\client\node_modules\webpack\lib\Compiler.js:1108:30) at D:\Harry\client\node_modules\webpack\lib\Compiler.js:1153:29 at eval (eval at create (D:\Harry\client\node_modules\tapable\lib\HookCodeFactory.js:33:10), :31:1)
Solution 1:[1]
You can try one of the followings.
- in tsconfig.json, in angularCompilerOptions have set ("enableIvy": false)
- Remove node_modules folder and reinstall packages
- ng update @angular/cli @angular/core
Hope it could help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | David Lu |