DataEase V2.10源码编译报错问题解决方法供参考

参考部署教程:源码部署 - DataEase 文档
关键版本信息:
DataEase V2.10源码
CentOS 7.9
java version “21.0.8” 2025-07-15 LTS
mvn 3.9.11
node v16.15.0
npm 8.5.5
git clone -b v2.10 GitHub - dataease/dataease: 🔥 人人可用的开源 BI 工具,数据可视化神器。An open-source BI tool alternative to Tableau.

前端编译报错如下:

[INFO] > dataease@0.0.0 build:flush
[INFO] > cd ./flushbonading && rimraf ./demo.html && npm i && node ./index.js
[INFO] 
[INFO] 
[INFO] up to date in 437ms
[INFO] 
[INFO] 6 packages are looking for funding
[INFO]   run `npm fund` for details
[INFO] file:///home/software/dataease/v2.10/dataease/core/core-frontend/flushbonading/index.js:3
[INFO] import pkg from '../package.json' with { type: "json" };
[INFO]                                   ^^^^
[INFO] 
[INFO] SyntaxError: Unexpected token 'with'
[INFO]     at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:117:18)
[INFO]     at ESMLoader.moduleProvider (node:internal/modules/esm/loader:337:14)
[INFO]     at async link (node:internal/modules/esm/module_job:70:21)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for core 2.10.13:
[INFO] 
[INFO] core ............................................... SUCCESS [  0.522 s]
[INFO] core-frontend ...................................... FAILURE [06:07 min]
[INFO] core-backend ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  06:08 min
[INFO] Finished at: 2025-10-17T08:43:11+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.1:npm (npm run build) on project core-frontend: Failed to run task: 'npm run build:distributed' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :core-frontend
[root@bigdata189 core]#

解决方案:
1.修改前端pom文件core/core-frontend/pom.xml:
原始:
v23.11.0
10.9.2
修改:
v16.15.0
8.5.5

2.修改core/core-frontend/flushbonading/index.js
原始:import pkg from ‘…/package.json’ with { type: “json” };
修改:import pkg from ‘…/package.json’ assert { type: ‘json’ };

最后编译成功!