tests: Pass `--legacy-peer-deps` flag to work around npm v7 bug

This flag is unknown to npm v6, but npm v6 silently ignores unknown
flags.
This commit is contained in:
Richard Hansen 2021-02-15 19:10:55 -05:00
parent 588b73f366
commit 6198e92706
9 changed files with 28 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -7,8 +7,8 @@ execute its own functionality based on these events.
Publicly available plugins can be found in the npm registry (see
<https://npmjs.org>). 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

View File

@ -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.

View File

@ -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));