From f0895dbee1c99977f286cf5e673c9a52942607cb Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 25 Feb 2022 09:49:11 -0500 Subject: [PATCH] Fix install on node 16 on ubuntu --- cli/npm/turbo-install/install.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cli/npm/turbo-install/install.js b/cli/npm/turbo-install/install.js index a9db420cb402f..484d7259b6d6a 100644 --- a/cli/npm/turbo-install/install.js +++ b/cli/npm/turbo-install/install.js @@ -22,7 +22,20 @@ let isToPathJS = true; function validateBinaryVersion(...command) { command.push("--version"); const stdout = child_process - .execFileSync(command.shift(), command) + .execFileSync(command.shift(), command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: "pipe", + }) .toString() .trim(); if (stdout !== TURBO_VERSION) {