diff --git a/test-api-openbis-javascript/build.gradle b/test-api-openbis-javascript/build.gradle
index 0abdedd8172f16437d71e5199b314a6f90b757b8..b0c70d0f9de95e34eb3b02cbeaadb7c7c0af7ed3 100644
--- a/test-api-openbis-javascript/build.gradle
+++ b/test-api-openbis-javascript/build.gradle
@@ -111,9 +111,10 @@ task copyTypeScriptDTS(type: Copy, dependsOn: [':api-openbis-typescript:generate
     into file('servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/lib/openbis/')
 }
 
-task compileTypeScript(type: Exec, dependsOn: copyTypeScriptDTS) {
+task compileTypeScript(type: NpxTask, dependsOn: copyTypeScriptDTS) {
     dependsOn 'npmInstall'
-    commandLine 'bash', '-c', "npx tsc --build servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/tsconfig.json"
+    command = 'tsc'
+    args = ['--build', 'servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/tsconfig.json']
 }
 
 test {