source code compile problem

61 views
Skip to first unread message

jianhua guo

unread,
Jul 14, 2023, 2:43:45 AM7/14/23
to go-cd
I use the following command './gradlew clean prepare' to build the gocd project. Failed with the following exception, can anyone help?

error Couldn't find match for "51ba3f91a6f19ef383c676431aa7f8c3fa73dab3" in "refs/heads/dependabot/npm_and_yarn/grunt-1.5.3,refs/heads/dependabot/npm_and_yarn/hosted-git-info-2.8.9,refs/heads/dependabot/npm_and_yarn/minimatch-3.0.8,refs/heads/dependabot/npm_and_yarn/minimist-and-mkdirp-1.2.8,refs/heads/karma-0.11,refs/heads/master,refs/tags/0.1.2,refs/tags/v0.1.3,refs/tags/v0.2.2,refs/tags/v0.2.3" for "https://github.com/dtabuenc/karma-html-reporter.git".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Chad Wilson

unread,
Jul 14, 2023, 3:06:32 AM7/14/23
to go...@googlegroups.com
Perhaps try yarn cache clean and rm -rf server/src/main/webapp/WEB-INF/rails/node_modules and try again?

If that doesn't work, what's your Yarn version? Do you have some non-standard global git or Yarn configuration?

-Chad

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/9a3d1fd9-4c6b-4eaf-a43a-c52986b0f038n%40googlegroups.com.

jianhua guo

unread,
Jul 16, 2023, 9:59:53 PM7/16/23
to go-cd
After running the command "yarn cache clean" and "rm -rf server/src/main/webapp/WEB-INF/rails/node_modules", I compile the project again, then seeing the following exception, is it the nodejs version is too high?

> Task :server:compileAssetsWebpackDev FAILED
[/Users/guojianhua/gtja/projects/gocd/server/src/main/webapp/WEB-INF/rails]$ yarn run webpack-dev --env outputDir=/Users/guojianhua/gtja/projects/gocd/server/src/main/webapp/WEB-INF/rails/public/assets/webpack --env licenseReportFile=/Users/guojianhua/gtja/projects/gocd/server/target/reports/yarn-license/license-report.json
yarn run v1.22.19
$ cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=development --env outputDir=/Users/guojianhua/gtja/projects/gocd/server/src/main/webapp/WEB-INF/rails/public/assets/webpack --env licenseReportFile=/Users/guojianhua/gtja/projects/gocd/server/target/reports/yarn-license/license-report.json
/opt/homebrew/Cellar/node/20.3.0_1/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
error Command failed with exit code 9.

Sriram Narayanan

unread,
Jul 16, 2023, 10:03:23 PM7/16/23
to go...@googlegroups.com
I’ve got a patch for this error that I did not get around to pushing to Chad for a review. See if it works for you:

diff --git a/server/src/main/webapp/WEB-INF/rails/package.json b/server/src/main/webapp/WEB-INF/rails/package.json
index d1731eb250..a7df131eb8 100644
--- a/server/src/main/webapp/WEB-INF/rails/package.json
+++ b/server/src/main/webapp/WEB-INF/rails/package.json
@@ -3,9 +3,9 @@
   "version": "0.0.1",
   "license": "Apache-2.0",
   "scripts": {
-    "webpack-watch": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=development --watch",
-    "webpack-dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=development",
-    "webpack-prod": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=production",
+    "webpack-watch": "node node_modules/cross-env/src/bin/cross-env.js NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=development --watch",
+    "webpack-dev": "node node_modules/cross-env/src/bin/cross-env.js NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=development",
+    "webpack-prod": "node node_modules/cross-env/src/bin/cross-env.js NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack/config/webpack.config.ts --color --mode=production",
     "jasmine-ci": "karma start --single-run",
     "jasmine-server": "karma start",
     "jasmine-old-ci": "jasmine-browser-runner runSpecs --config=spec/javascripts/support/jasmine-browser.js",

Chad Wilson

unread,
Jul 16, 2023, 10:04:20 PM7/16/23
to go...@googlegroups.com
Maybe, GoCD is built with Node 18 right now.

It still uses Webpack 4, which might not work correctly with Node 20.

-Chad

jianhua guo

unread,
Jul 17, 2023, 9:23:50 PM7/17/23
to go-cd
Using the Node 18 solve my problem,thanking everyone.
Reply all
Reply to author
Forward
0 new messages