From a66aeaf3828ed7fadaa9c9f3b4705b84244acda8 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Fri, 3 Dec 2021 15:57:44 +0300 Subject: [PATCH] Add network settings for kotlin npm install Because there can be multiple installations of NPM dependencies via Yarn, we need to work correctly consider concurrency of Yarn Because Yarn cache could face with problems during concurrent installation, need to limit network concurrency with only 1 instance and use mutex on network https://github.com/yarnpkg/yarn/issues/2146 --- build.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 5bd5a7d761d..5f0f8c4e5bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1171,6 +1171,9 @@ if (disableVerificationTasks) { plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class) { extensions.configure(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension::class.java) { nodeVersion = "16.13.0" + npmInstallTaskProvider?.configure { + args += listOf("--network-concurrency", "1", "--mutex", "network") + } ?: error("kotlinNpmInstall task should exist inside NodeJsRootExtension") } }