We need to plan to migrate our used Node.js version to the latest LTS available. EOL dates: https://endoflife.date/nodejs
I made a quick check in `KTD` which was not successful: ```shell sudo vim /etc/apt/sources.list.d/nodesource.list # switched 18 -> 20 sudo apt update; sudo apt install nodejs ``` after that, I tried to reinstall our node-related tools, replicating what the `KTD` build does: ```shell sudo su - $ cp /kohadevbox/koha/package.json . $ cp /kohadevbox/koha/yarn.lock . $ yarn install --modules-folder /kohadevbox/node_modules yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... error @achrinza/node-ipc@9.2.5: The engine "node" is incompatible with this module. Expected version "8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18". Got "20.18.0" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ``` I then tried telling yarn to upgrade things ```shell rm -rf /kohadevbox/node_modules/* yarn --modules-folder /kohadevbox/node_modules upgrade chown -R 501 /kohadevbox/node_modules/ mv /root/.cache/Cypress /kohadevbox && chown -R 501 /kohadevbox/Cypress cp package.json /kohadevbox/koha cp yarn.lock /kohadevbox/koha ``` Things that worked: * yarn api:bundle * yarn cypress run * yarn prettier koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts Things that DIDN'T work * yarn js:build * yarn css:build
It seems that @vue/cli-service | vue-cli is in maintenance mode and its use is discouraged. We should remove it because I think we are not using it anyway since we are past the scaffolding. https://github.com/vuejs/vue-cli?tab=readme-ov-file
Created attachment 174422 [details] [review] Bug 38426: Remove @vue/cli-service as it's scheduled for deprecation and not in use anymore
Correction: @vue/cli-service is used by Cypress unfortunately. Looking for a way around it.
Confirmed that @vue/cli-service really really doesn't seem needed. I also ended up proposing it's removal in a commit in Bug 38167 and I remember asking around stuff to test in our JS tooling to spot regressions. (for that ticket and another were I submitted other changes like that.) And no issue found :) > Correction: @vue/cli-service is used by Cypress unfortunately. Looking for a way around it. It's use is actually dead code: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38167#c4
It would maybe make sense to make this bug dependent on Bug 38149 and Bug 38167, so that we don't duplicate what needs to be done for compat with node v22.
Because tuxayo's patches already solve the problems lined out by Tomás here.
Hey all, Can confirm that these set of steps are what I did today, 14th Nov: ```shell $ sudo sed 's/18.x/20.x/g' -i /etc/apt/sources.list.d/nodesource.list $ sudo apt update ; sudo apt install nodejs -y $ sudo su - $ rm -rf /kohadevbox/node_modules $ cp /kohadevbox/koha/package.json . $ cp /kohadevbox/koha/yarn.lock . $ yarn install --modules-folder /kohadevbox/node_modules $ exit ## out of sudo $ yarn api:bundle ## ok $ yarn cypress run ## fail $ yarn prettier koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts ## ok $ yarn js:build ## ok $ yarn css:build ## ok ``` So, once Cypress is sorted, I think we'd be in a good shape to look at next steps. Jake.
Now that this depends on Bug 38167, there is no effective diff remaining in the patch here after applying on top of Bug 38167 and solving the conflicts. Should the patch be obsoleted? While keeping the usual signoff workflow. Because we have a test plan even without the patch. Because we are testing a change in the node version with the test plan. It fits the process in the end. If some other patch is needed for node upgrade then we would have patches again here. ----- In Bug 38503 we test by upgrading to node 22. And here it's node 20. Both are LTS? Should we aim for 22? v20 with it's EOL 30 Apr 2026 won't outlast Koha 25.05
What's the issue with the Cypress tests? I had a lot of flaky tests but by telling Cypress to retry they pass on the 1st retry. (Instead of rerunning them) +++ b/cypress.config.ts @@ -6,6 +6,7 @@ export default defineConfig({ videosFolder: "t/cypress/videos", defaultCommandTimeout: 10000, requestTimeout: 10000, + retries: 2, ------------------------------------ Except UsageReports_spec.ts AssertionError: Timed out retrying after 10000ms: expected '[{"erm_usage_muses.year":"2023","erm_usage_muses.report_type":"PR","erm_usage_muses.month":[1,2,3,4],"erm_usage_muses.metric_type":["Searches_Platform","Total_Item_Investigations","Total_Item_Requests","Unique_Item_Investigations","Unique_Item_Requests","Unique_Title_Investigations","Unique_Title_Requests"]}]' to include '2022' at Context.eval (webpack://koha/./t/cypress/integration/ERM/UsageReports_spec.ts:337:13) With the screenshots of retries showing and empty table. "No data available in the table" ------------------------------------ But that's not the topic as it happens with node 18,20 and 22.
bug 38770 is for the removal of @vue/cli-service and babel which is needed here and in another ticket. That's why it has it's own ticket. Because here we might identify more stuff needed for node > 18 support.
Not sure of the "Needs signoff" status - no patches to sign off...
We have pieces of a test plan even without a patch: Comment 1. And comment 8 for a bit more test cases at the end. And there is the dependency on the patch from bug 38770. But yes it looks weird. Because the change will be outside of Koha's repository. So not having an explicit test plan doesn't help. === Test plan === 1. Follow Bug 38770 test plan 2. Test the following things to actually test the node upgrade (It's not the main point of Bug 38770) 3. yarn api:bundle 4. yarn cypress run 5. sudo yarn add prettier --modules-folder /kohadevbox/node_modules 6. yarn prettier koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts 7. sudo yarn remove prettier --modules-folder /kohadevbox/node_modules That mess is because we don't have bug 38149 8. yarn js:build 9. yarn css:build Feel free to post an updated version if I forgot or mistaken things while piecing things together. comment 1 mentions these not working. * yarn js:build * yarn css:build and comment 8 mentions cypress not working These work on my side. So if they work for someone else, we can safely signoff.
Thanks Victor! I'll attempt to test once bug 38770 applies again. David
Everything as per the test plan in comment #13 worked for me. Signing off!
There is no patch here and no link in URL - where is the code? :)
(In reply to Katrin Fischer from comment #16) > There is no patch here and no link in URL - where is the code? :) The bug is umbrella-ish, and depends on others.