操作步骤:
1、打开demo工程
2、报错
"D:\Huawei\DevEco Studio\tools\node\node.exe" "D:\Huawei\DevEco Studio\tools\hvigor\bin\hvigorw.js" --sync -p product=default --analyze=normal --parallel --incremental --daemon
> hvigor ERROR: Cannot read properties of undefined (reading 'app')
* Try the following:
> Check whether the code in the hvigorconfig.ts and hvigorfile.ts files uses undefined attributes.
> Go to the official website for help
> More info: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-hvigor-faqs-0000001233028585-V5#section119742124315
> hvigor ERROR: BUILD FAILED in 87 ms
Process finished with exit code -1
正确的配置文件为app.json5,所以需要排查工程级AppScope内app.json5文件是否存在或者名称是否为app.json5
报错时模块内的配置文件格式错误,导致hvigor无法读取到app.json5中的参数,所以报错提示为无法读取app.json5文件中最外层的app字段。