diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 9adbf901..6f4b4cc5 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -57,8 +57,10 @@ jobs: sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport - name: Install Etherpad plugins + # The --legacy-peer-deps flag is required to work around a bug in npm v7: + # https://github.com/npm/cli/issues/2199 run: > - npm install --no-save + npm install --no-save --legacy-peer-deps ep_align ep_author_hover ep_cursortrace @@ -134,8 +136,10 @@ jobs: node-version: 12 - name: Install Etherpad plugins + # The --legacy-peer-deps flag is required to work around a bug in npm v7: + # https://github.com/npm/cli/issues/2199 run: > - npm install --no-save + npm install --no-save --legacy-peer-deps ep_align ep_author_hover ep_cursortrace diff --git a/.github/workflows/frontend-admin-tests.yml b/.github/workflows/frontend-admin-tests.yml index c8d064c8..92a9daa4 100644 --- a/.github/workflows/frontend-admin-tests.yml +++ b/.github/workflows/frontend-admin-tests.yml @@ -23,7 +23,9 @@ jobs: - name: Install etherpad plugins # We intentionally install an old ep_align version to test upgrades to the minor version number. - run: npm install --no-save ep_align@0.2.27 + # The --legacy-peer-deps flag is required to work around a bug in npm v7: + # https://github.com/npm/cli/issues/2199 + run: npm install --no-save --legacy-peer-deps ep_align@0.2.27 # This must be run after installing the plugins, otherwise npm will try to # hoist common dependencies by removing them from src/node_modules and diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 6ddd9cf6..9b0f7e22 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -62,8 +62,10 @@ jobs: run: src/tests/frontend/travis/sauce_tunnel.sh - name: Install Etherpad plugins + # The --legacy-peer-deps flag is required to work around a bug in npm v7: + # https://github.com/npm/cli/issues/2199 run: > - npm install --no-save + npm install --no-save --legacy-peer-deps ep_align ep_author_hover ep_cursortrace diff --git a/.github/workflows/load-test.yml b/.github/workflows/load-test.yml index 2dbe9815..787ef1dd 100644 --- a/.github/workflows/load-test.yml +++ b/.github/workflows/load-test.yml @@ -51,8 +51,10 @@ jobs: run: sudo npm install -g etherpad-load-test - name: Install etherpad plugins + # The --legacy-peer-deps flag is required to work around a bug in npm v7: + # https://github.com/npm/cli/issues/2199 run: > - npm install --no-save + npm install --no-save --legacy-peer-deps ep_align ep_author_hover ep_cursortrace diff --git a/.travis.yml b/.travis.yml index 5048d7f7..44a8693b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,10 @@ _install_libreoffice: &install_libreoffice >- sudo apt-get update && sudo apt-get -y install libreoffice libreoffice-pdfimport +# The --legacy-peer-deps flag is required to work around a bug in npm v7: +# https://github.com/npm/cli/issues/2199 _install_plugins: &install_plugins >- - npm install --no-save + npm install --no-save --legacy-peer-deps ep_align ep_author_hover ep_cursortrace diff --git a/README.md b/README.md index c06a9931..0e6c492f 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Etherpad is very customizable through plugins. Instructions for installing theme Run the following command in your Etherpad folder to get all of the features visible in the demo gif: ``` -npm install --no-save ep_headings2 ep_markdown ep_comments_page ep_align ep_font_color ep_webrtc ep_embedded_hyperlinks2 +npm install --no-save --legacy-peer-deps ep_headings2 ep_markdown ep_comments_page ep_align ep_font_color ep_webrtc ep_embedded_hyperlinks2 ``` ## Customize the style with skin variants diff --git a/doc/plugins.md b/doc/plugins.md index 1df620f9..1ed0c4f1 100644 --- a/doc/plugins.md +++ b/doc/plugins.md @@ -7,8 +7,8 @@ execute its own functionality based on these events. Publicly available plugins can be found in the npm registry (see ). Etherpad's naming convention for plugins is to prefix your plugins with `ep_`. So, e.g. it's `ep_flubberworms`. Thus you can install -plugins from npm, using `npm install --no-save ep_flubberworm` in Etherpad's -root directory. +plugins from npm, using `npm install --no-save --legacy-peer-deps +ep_flubberworm` in Etherpad's root directory. You can also browse to `http://yourEtherpadInstan.ce/admin/plugins`, which will list all installed plugins and those available on npm. It even provides diff --git a/src/bin/plugins/lib/README.md b/src/bin/plugins/lib/README.md index d2457b5f..e17a23ed 100755 --- a/src/bin/plugins/lib/README.md +++ b/src/bin/plugins/lib/README.md @@ -9,7 +9,7 @@ Explain what your plugin does and who it's useful for. ## Installing ``` -npm install --no-save [plugin_name] +npm install --no-save --legacy-peer-deps [plugin_name] ``` or Use the Etherpad ``/admin`` interface. diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index 104777d3..dd3dddc8 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -32,7 +32,9 @@ exports.uninstall = async (pluginName, cb = null) => { logger.info(`Uninstalling plugin ${pluginName}...`); try { // The --no-save flag prevents npm from creating package.json or package-lock.json. - await runCmd(['npm', 'uninstall', '--no-save', pluginName]); + // The --legacy-peer-deps flag is required to work around a bug in npm v7: + // https://github.com/npm/cli/issues/2199 + await runCmd(['npm', 'uninstall', '--no-save', '--legacy-peer-deps', pluginName]); } catch (err) { logger.error(`Failed to uninstall plugin ${pluginName}`); cb(err || new Error(err)); @@ -49,7 +51,9 @@ exports.install = async (pluginName, cb = null) => { logger.info(`Installing plugin ${pluginName}...`); try { // The --no-save flag prevents npm from creating package.json or package-lock.json. - await runCmd(['npm', 'install', '--no-save', pluginName]); + // The --legacy-peer-deps flag is required to work around a bug in npm v7: + // https://github.com/npm/cli/issues/2199 + await runCmd(['npm', 'install', '--no-save', '--legacy-peer-deps', pluginName]); } catch (err) { logger.error(`Failed to install plugin ${pluginName}`); cb(err || new Error(err));