Important note when upgrading NodeJS version: it can broke some plugins

Peertube 3.2.0 is out. It requires node 12. Debian buster comes with node 10. So you have to upgrade your node version.

On my server, it brokes an old plugin that I made : John / peertube-plugin-georegister · GitLab

With following errors:

error[30/05/2021 à 20:37:32] Cannot register plugin georegister, skipping.

{
  "err": {
    "stack": "/var/www/peertube/storage/plugins/node_modules/whois/index.js:1\n(function (exports, require, module, __filename, __dirname) { #!/usr/bin/env node\n                                                              ^\n\nSyntaxError: Invalid or unexpected token\n    at new Script (vm.js:88:7)\n    at createScript (vm.js:261:10)\n    at Object.runInThisContext (vm.js:309:10)\n    at wrapSafe (internal/modules/cjs/loader.js:902:15)\n    at Module._compile (internal/modules/cjs/loader.js:963:27)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n    at Module.load (internal/modules/cjs/loader.js:863:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n    at Module.require (internal/modules/cjs/loader.js:887:19)\n    at require (internal/modules/cjs/helpers.js:74:18)\n    at Object.<anonymous> (/var/www/peertube/storage/plugins/node_modules/whois-json/index.js:2:10)\n    at Module._compile (internal/modules/cjs/loader.js:999:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n    at Module.load (internal/modules/cjs/loader.js:863:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n    at Module.require (internal/modules/cjs/loader.js:887:19)\n    at require (internal/modules/cjs/helpers.js:74:18)\n    at Object.<anonymous> (/var/www/peertube/storage/plugins/node_modules/peertube-plugin-georegister/main.js:1:77)\n    at Module._compile (internal/modules/cjs/loader.js:999:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n    at Module.load (internal/modules/cjs/loader.js:863:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n    at Module.require (internal/modules/cjs/loader.js:887:19)\n    at require (internal/modules/cjs/helpers.js:74:18)\n    at PluginManager.<anonymous> (/var/www/peertube/versions/peertube-v3.2.0/dist/server/lib/plugins/plugin-manager.js:312:29)\n    at Generator.next (<anonymous>)\n    at /var/www/peertube/versions/peertube-v3.2.0/node_modules/tslib/tslib.js:117:75\n    at new Promise (<anonymous>)",
    "message": "Invalid or unexpected token"
  }
}

I think this error is caused by the node upgrade. To fix it, I simply had to uninstall and then install again the plugin.

I don’t know if Peertube could do something automatically? Launch yarn install at startup? Detect node version changes?

It’s a good question. Please create an issue on github. Don’t know what’s best to do

This plugin also stopped working for me, I have deleted it for now.

You have just to reinstall it, and it should work. Worked for me.

Ok.
There is another problem: when a plugin is broken (installation failed), it is displayed as «installed». There is only a message at the installation time that says that it fails. And when you go in the settings, there is only a message «this plugin has no settings». I will also open an issue for that.