From efc0d0d34932fb049befbc65b9bf9e76d43c5b25 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 7 May 2020 04:19:20 -0400 Subject: [PATCH] Skip install script if already installed (#91) The install script sometimes throws error on subsequent `yarn` installs since `yarn` seems to invoke install scripts when it is shuffling things around. It also causes issue for CI where the `node_modules` directory is cached across builds. --- npm/esbuild/install.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/npm/esbuild/install.js b/npm/esbuild/install.js index 5ac9cae3be1..af4513596ef 100644 --- a/npm/esbuild/install.js +++ b/npm/esbuild/install.js @@ -17,6 +17,10 @@ function installPackage(package) { env[key] = process.env[key]; } } + + if (fs.existsSync(installDir)) { + return; + } // Run "npm install" recursively to install this specific package fs.mkdirSync(installDir);