在部署项目到服务器上通过Jenkins实现,但是在执行打包命令的时候失败了,命令行提示了一下信息:
C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\DMIS>cd C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Jenkins\\.jenkins\\workspace\\DMIS && yarn & yarn build
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
[4/4] Building fresh packages...
Done in 33.08s.
yarn run v1.22.17
$ vue-cli-service build
- Building for production...
C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\DMIS\node_modules\neo-async\async.js:16
throw new Error('Callback was already called.');
^
Error: Callback was already called.
at throwError (C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\DMIS\node_modules\neo-async\async.js:16:11)
at C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\DMIS\node_modules\neo-async\async.js:2818:7
at processTicksAndRejections (internal/process/task_queues.js:77:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
查找了相关解决方案都没有解决,但是自己在服务器项目文件上通过cmd命令行操作打包命令时,可以正常打包文件。不知道是什么原因导致Jenkins执行该命令失败。