简体   繁体   中英

Nodejs Failed to compile for Angular project

can anyone help me to solve these issues? I have tried to install all neccesary modules but it is not working:

I am getting these errors:

/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js
Module build failed: Error: ENOENT: no such file or directory, open 'D:\AppDemo\node_modules\@angular\core\__ivy_ngcc__\fesm2015\core.js'
    at Object.openSync (fs.js:462:3)
    at Object.readFileSync (fs.js:364:35)
    at Storage.provideSync (D:\AppDemo\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:109:13)
    at CachedInputFileSystem.readFileSync (D:\AppDemo\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:289:32)
    at Observable._subscribe (D:\AppDemo\node_modules\@ngtools\webpack\src\webpack-input-host.js:36:51)
    at Observable._trySubscribe (D:\AppDemo\node_modules\rxjs\internal\Observable.js:44:25)
    at Observable.subscribe (D:\AppDemo\node_modules\rxjs\internal\Observable.js:30:22)
    at SyncDelegateHost._doSyncCall (D:\AppDemo\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:25:20)
    at SyncDelegateHost.read (D:\AppDemo\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:48:21)
    at WebpackCompilerHost.readFileBuffer (D:\AppDemo\node_modules\@ngtools\webpack\src\compiler_host.js:166:44)
    at VirtualFileSystemDecorator.readFile (D:\AppDemo\node_modules\@ngtools\webpack\src\virtual_file_system_decorator.js:43:54)
    at processResource (D:\AppDemo\node_modules\loader-runner\lib\LoaderRunner.js:202:11)
    at iteratePitchingLoaders (D:\AppDemo\node_modules\loader-runner\lib\LoaderRunner.js:158:10)
    at runLoaders (D:\AppDemo\node_modules\loader-runner\lib\LoaderRunner.js:365:2)
    at NormalModule.doBuild (D:\AppDemo\node_modules\webpack\lib\NormalModule.js:295:3)
    at NormalModule.build (D:\AppDemo\node_modules\webpack\lib\NormalModule.js:446:15)``
Your help is much appreciated

Looks like node_module packet is broken. Try typing on console:

rm -rf node_modules

and then:

npm install

Hope it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM