Peertube install instructions

I spent several days trying to get peertube working. I am currently stuck here error hdr-histogram-js@3.0.0: The engine "node" is incompatible with this module. Expected version ">=14". Got "12.22.5" error Found incompatible module.

PeerTube documentation is optimized for minimum bash code. This seems to work if nothing goes wrong. (human error, slow system). The condensed code is hard for human to understand, and system needs to be fixed before the code is re-run a second time. I re-wrote some of the code in a more extracted format, (easier for human to understand), optimised for my OS and system, with more details and steps. Should I post it in forum here? I went to

forum rules: Sorry, new users can only put 2 links in a post. So I remove some links here.

but it does not say how to send my code. I am trying to install to PC localhost. Later I might try VPS. Later I might add domain name. Documentation does not say which of these are required. Can I use IP address? Compatible VPS hardware will cost roughly twenty US dollars per month. Is there a service that can install peertube for me? I probably can not afford it right now, I am just looking.

Hi,

As the dependencies pages and your error say, you need a newer nodejs version (14 at least).

I don’t know if a domain name is required, I never use IP as hostname. But, AFAIK when you start with a specific IP/hostname, you can’t change later.

Hope this will help you.

Thank you Thomas. I spent several days trying, and now I try again. This forum does not allow me to post links so I can not link to where I got my instructions. I ran sudo apt install nodejs -y nodejs is already the newest version (12.22.5~dfsg-2~11u1).

I downloaded node-v16.15.1-linux-x64.tar.xz and extracted it. Now what?

After I tried manual install, node –version
node:internal/modules/cjs/loader:936
Error: Cannot find module ‹ /home/bullseye/–version ›

I admit this problem of nodejs seems a little off topic, but I suspect it has come up many times when working with peertube. I have PC with debian bullseye, localhost. Any help?

Following the link in the dependencies guide, you will first get this page: Installing Node.js via package manager | Node.js

I agree that this page is not very clear, but if you click on the first link, you will get there: distributions/README.md at master · nodesource/distributions · GitHub

Read the page, and search for the install instruction for node 14 or 16 (14 is the minimum for the current Peertube version, 16 is the current nodejs LTS version).

Should be something like:

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs

The first line will add a package repository in /etc/apt/source.d , then you can upgrade or install node. If you already have node 12 installed, you should do the upgrade with «apt update && apt upgrade».

Thank you JohnLivingston. The command as root curl -fsSL https://deb.nodesource.com/setup_16.x | bash - created these files:

/etc/apt/sources.list.d/nodesource.list
deb [signed-by=/usr/share/keyrings/nodesource.gpg] Index of /node_18.x/ bullseye main
deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] Index of /node_18.x/ bullseye main

/usr/share/keyrings/nodesource.gpg

Then, this install seems to work: sudo apt-get install -y nodejs

To check version of node, run the code again: sudo apt install nodejs -y nodejs is already the newest version (18.3.0-deb-1nodesource1).

To check version of node, this also works: node Welcome to Node.js v18.3.0.

Happy to get node working. peertube Dependencies says to Install yarn, and be sure to have a recent version. The yarn website is confusing. It says (on June 17, 2022): latest v4.0.0-rc.9. Classic Stable: v1.22.19.

I did this:

yarn yarn install v1.22.19 success Already up-to-date.

sudo npm install --global --force yarn
sudo npm install -g npm@8.12.2

yarn --version 1.22.19

sudo corepack enable
yarn set version stable

yarn --version 3.2.1

cd /var/www/peertube/peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile

bullseye@debian:~$ cd /var/www/peertube/peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
yarn install v1.22.19
[1/5] Validating package.json…
[2/5] Resolving packages…
success Already up-to-date.
$ test -n « $NOCLIENT » || (cd client && yarn install --pure-lockfile)
yarn install v1.22.19
[1/4] Resolving packages…
[2/4] Fetching packages…
error eslint-plugin-jsdoc@38.0.6: The engine « node » is incompatible with this module. Expected version « ^12 || ^14 || ^16 || ^17 ». Got « 18.3.0 »
error Found incompatible module.
info Visit xxxx for documentation about this command.
error Command failed with exit code 1.
info Visit xxxx for documentation about this command.
bullseye@debian:/var/www/peertube/peertube-latest$

What should I do now?

Logs you pasted suggest you used setup_18 and not setup_16.
The error seems to be related to a Peertube dependency that is not yet compatible with node 18.

You should downgrade node to version 16 (current LTS version, LTS meaning «long term support»).
To do so, maybe try:

apt remove nodejs
apt purge nodejs
rm /etc/apt/sources.list.d/nodesource.list
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt install  nodejs

Then install yarn again, as you did.

Thank you JohnLivingston for your help. I now have node version 16. I am making progress. Here is where some problems start showing up. Install Peertube with internet connection on: cd /var/www/peertube/peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile 1259 packages. 1608. many warnings but no errors.

bullseye@debian:/var/www/peertube/versions$ sudo -u peertube unzip -q PeerTube-release-4.2.0.zip
bullseye@debian:/var/www/peertube/versions$ sudo -u peertube ln -s /var/www/peertube/versions/PeerTube-release-4.2.0 /var/www/peertube/peertube-latest
bullseye@debian:/var/www/peertube/versions$ cd /var/www/peertube/peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @aws-sdk/lib-storage@3.72.0" has unmet peer dependency "@aws-sdk/abort-controller@^3.0.0".
warning " > @typescript-eslint/eslint-plugin@5.19.0" has unmet peer dependency "@typescript-eslint/parser@^5.0.0".
warning " > eslint-config-standard-with-typescript@21.0.1" has incorrect peer dependency "@typescript-eslint/eslint-plugin@^4.0.1".
warning " > eslint-config-standard-with-typescript@21.0.1" has incorrect peer dependency "eslint@^7.12.1".
warning " > eslint-config-standard-with-typescript@21.0.1" has incorrect peer dependency "eslint-plugin-promise@^4.2.1 || ^5.0.0".
warning "eslint-config-standard-with-typescript > @typescript-eslint/parser@4.33.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0 || ^7.0.0".
warning "eslint-config-standard-with-typescript > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint@^7.12.1".
warning "eslint-config-standard-with-typescript > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint-plugin-promise@^4.2.1 || ^5.0.0".
warning "swagger-cli > @apidevtools/swagger-cli > @apidevtools/swagger-parser@10.0.3" has unmet peer dependency "openapi-types@>=7".
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
$ test -n "$NOCLIENT" || (cd client && yarn install --pure-lockfile)
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > bootstrap@4.6.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning " > bootstrap@4.6.1" has unmet peer dependency "popper.js@^1.16.1".
warning " > primeng@13.3.0" has unmet peer dependency "primeicons@^5.0.0".
warning " > wdio-chromedriver-service@7.3.2" has unmet peer dependency "webdriverio@^7.0.0".
[4/4] Building fresh packages...
Done in 101.09s.
Done in 174.99s.
bullseye@debian:/var/www/peertube/peertube-latest$ 

I guess all these warnings are normal and can be ignored? And what are the 1259 packages? It seems they are automatically downloaded from somewhere. I would think that PeerTube-release-4.2.0.zip should contain these. Can they all be put into an archive file? Then 1608 installations? I like to download everything first, then turn off internet connection before running install. But I can change if needed.

I do not know what to change in the production example configuration: /var/www/peertube/config/production.yaml. So I do not change it.

The nginx configuration template /etc/nginx/sites-available/peertube says you need a certificate to run in production. This seems to be my current biggest problem. I am trying to setup peertube to run on off-line localhost. Of course I can invent my own domain name there. How to get a certificate? Are there other ways to run other than production?

I will be away for several weeks and will return in July 2022.

Yes, you can ignore them.

That’s NPM dependencies. NPM is a package manager for NodeJS.

If you want to run the server locally for tests, you should follow the developper guide.
Check here for example: Welcome to the contributing guide for PeerTube | PeerTube documentation

Basically, you don’t have to use NGINX. Once you setup the Node environment, the postgresql database, and the redis database, you can launch Peertube from a terminal using npm.
Or, if you want Peertube to always run, you can use systemd (as on the documentation you followed).
By default, Peertube will be available at the address http://localhost:9000.

Note: as you already followed the production guide, the fastest way to have your Peertube running (without using systemd) is:

cd /var/www/peertube;
sudo -u peertube npm start

And ctrl+c to stop the server.

Important note: Peertube does not allow a domain name change. So, if you plan to test and then make a production server, you will have to delete the database and start over.

Just a quick question for the experts here, does peertube requires a certain operating system or any will do? I cannot successfully get the peertube and I am thinking that my device is just too slow for the app.

Any GNU/Linux system should work

Can someone do this install for me? Volunteer webmaster wanted.

Thanks for sharing this.