Start after upgrade to 6.2.1 fails with error SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener'

Hello,

OS: Debian 11
after upgrading PeerTube from 6.0.4 to 6.1.2 I am not able to start the peertube service with this error:

Aug 15 10:33:48 video systemd[1]: Started PeerTube daemon.
Aug 15 10:33:49 video peertube[23244]: file:///var/www/peertube/versions/peertube-v6.2.1/node_modules/execa/lib/utils/max-listeners.js:1
Aug 15 10:33:49 video peertube[23244]: import {addAbortListener} from 'node:events';
Aug 15 10:33:49 video peertube[23244]:         ^^^^^^^^^^^^^^^^
Aug 15 10:33:49 video peertube[23244]: SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener'
Aug 15 10:33:49 video peertube[23244]:     at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
Aug 15 10:33:49 video peertube[23244]:     at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Aug 15 10:33:49 video peertube[23244]: Node.js v18.17.1
Aug 15 10:33:49 video systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Aug 15 10:33:49 video systemd[1]: peertube.service: Failed with result 'exit-code'.
Aug 15 10:33:49 video systemd[1]: peertube.service: Consumed 1.804s CPU time.
Aug 15 10:33:49 video systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
Aug 15 10:33:49 video systemd[1]: Stopped PeerTube daemon.
Aug 15 10:33:49 video systemd[1]: peertube.service: Consumed 1.804s CPU time.
Aug 15 10:33:49 video systemd[1]: peertube.service: Start request repeated too quickly.
Aug 15 10:33:49 video systemd[1]: peertube.service: Failed with result 'exit-code'.
Aug 15 10:33:49 video systemd[1]: Failed to start PeerTube daemon.

The upgrade script works after upgrading node from 20.3.1 to 20.10.0 or 20.16.0 but I can’t start PeerTube.

Thanks
André

Please use Node >= 18.20 (your node version used by peertube is v18.17)

If you use debian/ubuntu, install nodejs from GitHub - nodesource/distributions: NodeSource Node.js Binary Distributions

how do I make PeerTube to use the proper Node version? I installed Node 18.20.4 but it seems PeerTube still uses v18.17.1 if I restart after upgrading again

peertube@video:~/versions$ node -v
v18.20.4

Nevermind, I had to reinstall node via the install script. Now everything works fine.

Thanks for the hint.

Can you mark the thread as solved please? So that people with the same error will find the solution more easily.