From 9b5eecba8f6937fabae2ca2d931455605599ff0f Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 10 Oct 2023 11:14:39 +0100 Subject: [PATCH] Yarn pnp unsupported, use alternative nodeLinker --- docs/install.md | 6 ++++-- lib/sharp.js | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/install.md b/docs/install.md index 68200997..9f676773 100644 --- a/docs/install.md +++ b/docs/install.md @@ -5,13 +5,15 @@ npm install sharp ``` ```sh -yarn add sharp +pnpm add sharp ``` ```sh -pnpm add sharp +yarn add sharp ``` +Yarn Plug'n'Play is unsupported. + ## Prerequisites * Node.js >= 18.17.0 diff --git a/lib/sharp.js b/lib/sharp.js index 231a7829..6f28fcad 100644 --- a/lib/sharp.js +++ b/lib/sharp.js @@ -53,6 +53,10 @@ try { if (errPackage.code === 'ERR_DLOPEN_DISABLED') { help.push('- Run Node.js without using the --no-addons flag'); } + if (process.versions.pnp) { + help.push('- Use a supported yarn linker, either pnpm or node-modules'); + help.push(' yarn config set nodeLinker node-modules'); + } // Link to installation docs if (isLinux && /Module did not self-register/.test(errLocal.message + errPackage.message)) { help.push('- Using worker threads on Linux? See https://sharp.pixelplumbing.com/install#worker-threads');