Require NodeJS 22

This commit is contained in:
Chocobozzz
2026-04-24 15:11:53 +02:00
parent a817434162
commit 1947d5fd59
11 changed files with 36 additions and 79 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
- uses: './.github/actions/reusable-prepare-peertube-build' - uses: './.github/actions/reusable-prepare-peertube-build'
with: with:
node-version: '20.x' node-version: '22.x'
- uses: './.github/actions/reusable-prepare-peertube-run' - uses: './.github/actions/reusable-prepare-peertube-run'
+1 -1
View File
@@ -54,7 +54,7 @@ jobs:
- uses: './.github/actions/reusable-prepare-peertube-build' - uses: './.github/actions/reusable-prepare-peertube-build'
if: ${{ matrix.build-peertube }} if: ${{ matrix.build-peertube }}
with: with:
node-version: '20.x' node-version: '22.x'
- name: Build - name: Build
if: ${{ matrix.build-peertube }} if: ${{ matrix.build-peertube }}
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- uses: './.github/actions/reusable-prepare-peertube-build' - uses: './.github/actions/reusable-prepare-peertube-build'
with: with:
node-version: '20.x' node-version: '22.x'
- name: Build - name: Build
run: npm run nightly run: npm run nightly
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
- uses: './.github/actions/reusable-prepare-peertube-build' - uses: './.github/actions/reusable-prepare-peertube-build'
with: with:
node-version: '20.x' node-version: '22.x'
- name: Build - name: Build
run: npm run build -- --analyze-bundle run: npm run build -- --analyze-bundle
+1 -1
View File
@@ -69,7 +69,7 @@ jobs:
- uses: './.github/actions/reusable-prepare-peertube-build' - uses: './.github/actions/reusable-prepare-peertube-build'
with: with:
node-version: '20.x' node-version: '22.x'
- uses: './.github/actions/reusable-prepare-peertube-run' - uses: './.github/actions/reusable-prepare-peertube-run'
+2 -2
View File
@@ -45,7 +45,7 @@ handled via FFmpeg, with optional distributed runners.
### Prerequisites ### Prerequisites
- Node.js >= 20.x - Node.js >= 22.x
- pnpm >= 10.9 (do **not** use npm or yarn for install) - pnpm >= 10.9 (do **not** use npm or yarn for install)
- PostgreSQL >= 10 with `pg_trgm` and `unaccent` extensions - PostgreSQL >= 10 with `pg_trgm` and `unaccent` extensions
- Redis >= 6.x - Redis >= 6.x
@@ -278,7 +278,7 @@ docker run -p 8082:8080 \
### CI pipeline ### CI pipeline
GitHub Actions (`.github/workflows/test.yml`), Ubuntu 22.04, Node.js GitHub Actions (`.github/workflows/test.yml`), Ubuntu 22.04, Node.js
20.x. Matrix strategy runs suites in parallel: `types-package`, 22.x. Matrix strategy runs suites in parallel: `types-package`,
`client`, `api-1`–`api-5`, `cli-plugin`, `lint`, `transcription`, `client`, `api-1`–`api-5`, `cli-plugin`, `lint`, `transcription`,
`external-plugins`. `external-plugins`.
+1 -1
View File
@@ -5,7 +5,7 @@
"private": true, "private": true,
"licence": "AGPL-3.0", "licence": "AGPL-3.0",
"engines": { "engines": {
"node": ">=20.x", "node": ">=22.x",
"pnpm": ">=10.9" "pnpm": ">=10.9"
}, },
"type": "module", "type": "module",
@@ -331,15 +331,11 @@ export function checkNodeVersion () {
logger.debug(`Checking NodeJS version ${v}`) logger.debug(`Checking NodeJS version ${v}`)
if (major < 20) { if (major < 22) {
throw new Error(`Your NodeJS version ${v} is not supported. Please upgrade.`) throw new Error(`Your NodeJS version ${v} is not supported. Please upgrade to NodeJS 22 or NodeJS 24`)
}
if (major === 20 && minor < 19) {
throw new Error(`NodeJS v20.19 and above is required`)
} }
if (major === 22 && minor < 12) { if (major === 22 && minor < 12) {
throw new Error(`NodeJS v22.12 and above is required`) throw new Error(`NodeJS >= v22.12 or NodeJS 24 is required`)
} }
} }
+22 -61
View File
@@ -4,8 +4,8 @@
Main dependencies supported by PeerTube: Main dependencies supported by PeerTube:
* `node` LTS (**>= 20.19 and < 21** or **>= 22.12 and <23**) * `node` LTS (**>= 22.12 and <25**)
* `yarn` 1.x for **PeerTube <= 7.3** or `pnpm` >= 10.x for **PeerTube >= 8.0** * `pnpm` >= 10.x
* `postgres` >=10.x * `postgres` >=10.x
* `redis-server` >=6.2 * `redis-server` >=6.2
* `ffmpeg` >=4.3 (using a ffmpeg static build [is not recommended](https://github.com/Chocobozzz/PeerTube/issues/6308)) * `ffmpeg` >=4.3 (using a ffmpeg static build [is not recommended](https://github.com/Chocobozzz/PeerTube/issues/6308))
@@ -27,12 +27,9 @@ _note_: only **LTS** versions of external dependencies are supported. If no LTS
1. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access. You can see a guide for how to do this in Debian/Ubuntu [here](https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-20-04). 1. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access. You can see a guide for how to do this in Debian/Ubuntu [here](https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-20-04).
1. Install NodeJS 20.x: https://nodesource.com/products/distributions 1. Install NodeJS 22.x: https://nodesource.com/products/distributions
1. **PeerTube <= v7.3 only** Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): 1. Install [PNPM](https://pnpm.io/fr/installation):
[https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab)
1. **PeerTube >= v8.0 only** Install [PNPM](https://pnpm.io/fr/installation):
```sh ```sh
sudo npm install -g pnpm sudo npm install -g pnpm
@@ -67,9 +64,7 @@ sudo systemctl start redis postgresql
Run: Run:
```sh ```sh
sudo pacman -S nodejs-lts-iron yarn ffmpeg postgresql openssl redis git wget unzip python python-pip base-devel npm nginx sudo pacman -S nodejs-lts-iron ffmpeg postgresql openssl redis git wget unzip python python-pip base-devel npm nginx pnpm
sudo pacman -S yarn # PeerTube <= v7.3 only
sudo pacman -S pnpm # PeerTube >= v8.0 only
``` ```
Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis: Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
@@ -80,11 +75,9 @@ sudo systemctl start redis postgresql
## CentOS 7 ## CentOS 7
1. Install NodeJS 20.x: https://nodesource.com/products/distributions 1. Install NodeJS 22.x: https://nodesource.com/products/distributions
1. **PeerTube <= v7.3 only** Install [yarn](https://yarnpkg.com/en/docs/install): 1. Install [PNPM](https://pnpm.io/fr/installation):
1. **PeerTube >= v8.0 only** Install [PNPM](https://pnpm.io/fr/installation):
```sh ```sh
sudo npm install -g pnpm sudo npm install -g pnpm
@@ -131,12 +124,9 @@ sudo systemctl enable --now postgresql
## Centos 8 ## Centos 8
1. Install NodeJS 20.x: https://nodesource.com/products/distributions 1. Install NodeJS 22.x: https://nodesource.com/products/distributions
1. **PeerTube <= v7.3 only** Install yarn: 1. Install [PNPM](https://pnpm.io/fr/installation):
[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
1. **PeerTube >= v8.0 only** Install [PNPM](https://pnpm.io/fr/installation):
```sh ```sh
sudo npm install -g pnpm sudo npm install -g pnpm
@@ -186,17 +176,12 @@ sudo systemctl enable --now postgresql
sudo dnf update -y sudo dnf update -y
``` ```
1. Install NodeJS 20.x: 1. Install NodeJS 22.x:
```sh ```sh
sudo dnf module install -y nodejs:20 sudo dnf module install -y nodejs:22
``` ```
1. **PeerTube <= v7.3 only** Install yarn: 1. Install PNPM:
```sh
sudo npm install --global yarn
```
1. **PeerTube >= v8.0 only** Install PNPM:
```sh ```sh
sudo npm install --global pnpm sudo npm install --global pnpm
``` ```
@@ -236,12 +221,9 @@ sudo systemctl enable --now postgresql
1. (Optional) Install certbot (choose instructions for your distribution): 1. (Optional) Install certbot (choose instructions for your distribution):
[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
1. Install NodeJS 20.x: https://nodesource.com/products/distributions 1. Install NodeJS 22.x: https://nodesource.com/products/distributions
1. **PeerTube <= v7.3 only** Install yarn: 1. Install PNPM:
[https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
1. **PeerTube >= v8.0 only** Install PNPM:
```sh ```sh
sudo npm install --global pnpm sudo npm install --global pnpm
``` ```
@@ -335,17 +317,10 @@ sudo systemctl enable --now postgresql
1. Install NodeJS 1. Install NodeJS
```sh ```sh
sudo dnf module install nodejs:20 sudo dnf module install nodejs:22
``` ```
1. **PeerTube <= v7.3 only** Install Yarn 1. Install PNPM:
```sh
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo dnf install yarn
```
1. **PeerTube >= v8.0 only** Install PNPM:
```sh ```sh
sudo npm install --global pnpm sudo npm install --global pnpm
``` ```
@@ -438,17 +413,12 @@ On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail
```sh ```sh
pkg pkg
pkg update pkg update
pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm yarn ffmpeg unzip pkg install -y sudo bash wget git python nginx pkgconf postgresql13-server postgresql13-contrib redis openssl node npm ffmpeg unzip
``` ```
1. install `sharp` build dependencies: https://sharp.pixelplumbing.com/install/#building-from-source 1. install `sharp` build dependencies: https://sharp.pixelplumbing.com/install/#building-from-source
1. **PeerTube <= v7.3 only** Install Yarn: 1. Install PNPM:
```sh
pkg install -y yarn
```
1. **PeerTube >= v8.0 only** Install PNPM:
```sh ```sh
sudo npm install --global pnpm sudo npm install --global pnpm
``` ```
@@ -488,8 +458,7 @@ On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail
```sh ```sh
brew install ffmpeg nginx postgresql openssl gcc make redis git brew install ffmpeg nginx postgresql openssl gcc make redis git
brew install yarn # PeerTube <= v7.3 only brew install pnpm
brew install pnpm # PeerTube >= v8.0 only
``` ```
1. Run the services: 1. Run the services:
@@ -508,7 +477,6 @@ On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail
``` ```
net-libs/nodejs net-libs/nodejs
sys-apps/yarn
sys-apps/pnpm sys-apps/pnpm
media-video/ffmpeg[x264] # Optionally add vorbis,vpx media-video/ffmpeg[x264] # Optionally add vorbis,vpx
dev-db/postgresql dev-db/postgresql
@@ -523,13 +491,12 @@ On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail
# app-crypt/certbot # app-crypt/certbot
``` ```
1. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 yarn: 1. If you are on a "stable" Gentoo you need to accept the testing keyword ~amd64 pnpm:
```sh ```sh
mkdir -p /etc/portage/package.keywords mkdir -p /etc/portage/package.keywords
cat << EOF >> /etc/portage/package.keywords/peertube cat << EOF >> /etc/portage/package.keywords/peertube
# required by yarn (argument) for PeerTube # required by pnpm (argument) for PeerTube
sys-apps/yarn ~amd64
sys-apps/pnpm ~amd64 sys-apps/pnpm ~amd64
EOF EOF
``` ```
@@ -569,13 +536,7 @@ On a fresh install of [FreeBSD](https://www.freebsd.org), new system or new jail
pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl pkg_add sudo bash wget git python nginx pkgconf postgresql-server postgresql-contrib redis openssl
``` ```
1. **PeerTube <= v7.3 only** Install yarn: 1. Install PNPM:
```sh
npm install --global yarn
```
1. **PeerTube >= v8.0 only** Install PNPM:
```sh ```sh
sudo npm install --global pnpm sudo npm install --global pnpm
``` ```
+2 -2
View File
@@ -12,7 +12,7 @@ It can be launched from a remote server/computer to easily upload videos, manage
Ensure you have `node` installed on your system: Ensure you have `node` installed on your system:
```bash ```bash
node --version # Should be >= 20.x node --version # Should be >= 22.x
``` ```
Then install the CLI: Then install the CLI:
@@ -143,7 +143,7 @@ You can read the admin documentation on how to use PeerTube runners on https://d
Ensure you have `node`, `ffmpeg` and `ffprobe` installed on your system: Ensure you have `node`, `ffmpeg` and `ffprobe` installed on your system:
```bash ```bash
node --version # Should be >= 20.x node --version # Should be >= 22.x
ffprobe -version # Should be >= 4.3 ffprobe -version # Should be >= 4.3
ffmpeg -version # Should be >= 4.3 ffmpeg -version # Should be >= 4.3
``` ```
+1 -1
View File
@@ -1,4 +1,4 @@
FROM node:20-trixie-slim FROM node:22-trixie-slim
ARG ALREADY_BUILT=0 ARG ALREADY_BUILT=0