Azure Devops-生成定义ng生成错误无法读取未定义的属性'_statSync'

时间:2018-10-31 10:53:37

标签: angular azure-devops angular5 devops-services

我正在使用Angular 5.2,并在具有构建的Azure DevOps中构建项目。

今天,DevOps构建定义突然开始在ng build命令中引发错误。

这是错误的快照:-

**

2018-10-31T09:39:04.6711840Z ##[section]Starting: Step-3.B :: Build PDL Angular Project 
2018-10-31T09:39:04.6719705Z ==============================================================================
2018-10-31T09:39:04.6719786Z Task         : Command Line
2018-10-31T09:39:04.6719821Z Description  : Run a command line with arguments
2018-10-31T09:39:04.6719855Z Version      : 1.1.3
2018-10-31T09:39:04.6719889Z Author       : Microsoft Corporation
2018-10-31T09:39:04.6719946Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2018-10-31T09:39:04.6719980Z ==============================================================================
2018-10-31T09:39:04.6819517Z ##[command]ng build --prod -e=dev --base-href=/
2018-10-31T09:40:11.5955017Z [0mDate: [1m[37m2018-10-31T09:40:11.592Z[39m[22m[0m
2018-10-31T09:40:11.5955351Z [0m[0m
2018-10-31T09:40:11.5955401Z [0m[1m[31mERROR in ./node_modules/core-js/es6/date.js[39m[22m[0m
2018-10-31T09:40:11.5955469Z [0m[1m[31mModule build failed: TypeError: Cannot read property '_statSync' of undefined[39m[22m[0m
2018-10-31T09:40:11.5955575Z [0m[1m[31m    at stat (D:\a\1\s\node_modules\@ngtools\webpack\src\virtual_file_system_decorator.js:26:29)[39m[22m[0m
2018-10-31T09:40:11.5955620Z [0m[1m[31m    at toDepDetails (D:\a\1\s\node_modules\cache-loader\dist\index.js:66:5)[39m[22m[0m
2018-10-31T09:40:11.5955663Z [0m[1m[31m    at arrayIterator (D:\a\1\s\node_modules\neo-async\async.js:3780:9)[39m[22m[0m
2018-10-31T09:40:11.5955726Z [0m[1m[31m    at timesSync (D:\a\1\s\node_modules\neo-async\async.js:2292:7)[39m[22m[0m
2018-10-31T09:40:11.5955768Z [0m[1m[31m    at Object.mapLimit (D:\a\1\s\node_modules\neo-async\async.js:3775:5)[39m[22m[0m
2018-10-31T09:40:11.5955822Z [0m[1m[31m    at Array.<anonymous> (D:\a\1\s\node_modules\cache-loader\dist\index.js:89:18)[39m[22m[0m
2018-10-31T09:40:11.5955885Z [0m[1m[31m    at arrayEachFunc (D:\a\1\s\node_modules\neo-async\async.js:2512:19)[39m[22m[0m
2018-10-31T09:40:11.5955933Z [0m[1m[31m    at Object.parallel (D:\a\1\s\node_modules\neo-async\async.js:6867:9)[39m[22m[0m
2018-10-31T09:40:11.5955974Z [0m[1m[31m    at Object.loader (D:\a\1\s\node_modules\cache-loader\dist\index.js:88:9)[39m[22m[0m
2018-10-31T09:40:11.5956034Z [0m[1m[31mERROR in ./src/app/app.module.ngfactory.js[39m[22m[0m

**

我们没有在Build定义中对DevOps进行任何更改。

请告知,这可能是问题所在。

1 个答案:

答案 0 :(得分:0)

在package.json文件中添加“ cache-loader”:“ 1.2.2”可解决此问题。