From 0e4b0fedade7c2512bda5676a8a569e3d83f68f8 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 4 May 2026 00:01:02 +0300 Subject: [PATCH 01/21] test: fix tests requiring git core.autocrlf=true on windows Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- test/README.md | 3 --- test/parallel/test-snapshot-typescript.js | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/README.md b/test/README.md index 02359ca68265..61f5b8bda918 100644 --- a/test/README.md +++ b/test/README.md @@ -8,9 +8,6 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md On how to run tests in this directory, see [the contributing guide](../doc/contributing/pull-requests.md#step-6-test). -For the tests to run on Windows, be sure to clone Node.js source code with the -`autocrlf` git config flag set to true. - ## Test Directories | Directory | Runs on CI | Purpose | diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index 98502ccebedf..bed1e1e79dfa 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -9,12 +9,13 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); const fs = require('fs'); +const os = require('os'); tmpdir.refresh(); const blobPath = tmpdir.resolve('snapshot.blob'); // Concat test/fixtures/snapshot/typescript.js with -// test/fixtures/snapshot/typescript.js into +// test/fixtures/snapshot/typescript-main.js into // tmpdir/snapshot.js. const file = tmpdir.resolve('snapshot.js'); fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file); @@ -57,7 +58,8 @@ fs.appendFileSync(file, assert.strictEqual(child.status, 0); const result = fs.readFileSync(outPath, 'utf8'); - const expected = fs.readFileSync( - fixtures.path('snapshot', 'ts-example.js'), 'utf8'); + const expected = fs + .readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8') + .replace(/\r?\n/g, os.EOL); assert.strictEqual(result, expected); } From 158cd25b7c07e215ef1b304a5c773fa0055dfa3c Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 17:30:48 +0300 Subject: [PATCH 02/21] test: assert tests don't depend on core.autocrlf value --- .github/workflows/coverage-windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index b282f03ccb7b..7c8323682f23 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -68,8 +68,12 @@ permissions: jobs: coverage-windows: if: github.event.pull_request.draft == false + strategy: + matrix: + autocrlf: [true, input, false] runs-on: windows-2025 steps: + - run: git config --global core.autocrlf ${{ matrix.autocrlf }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false From 7c78ce078ec78233dc90eea7cdb5cfa00b151ac0 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 18:38:53 +0300 Subject: [PATCH 03/21] Revert "test: fix tests requiring git core.autocrlf=true on windows" This reverts commit 0e4b0fedade7c2512bda5676a8a569e3d83f68f8. --- test/README.md | 3 +++ test/parallel/test-snapshot-typescript.js | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/README.md b/test/README.md index 61f5b8bda918..02359ca68265 100644 --- a/test/README.md +++ b/test/README.md @@ -8,6 +8,9 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md On how to run tests in this directory, see [the contributing guide](../doc/contributing/pull-requests.md#step-6-test). +For the tests to run on Windows, be sure to clone Node.js source code with the +`autocrlf` git config flag set to true. + ## Test Directories | Directory | Runs on CI | Purpose | diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index bed1e1e79dfa..98502ccebedf 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -9,13 +9,12 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); const fs = require('fs'); -const os = require('os'); tmpdir.refresh(); const blobPath = tmpdir.resolve('snapshot.blob'); // Concat test/fixtures/snapshot/typescript.js with -// test/fixtures/snapshot/typescript-main.js into +// test/fixtures/snapshot/typescript.js into // tmpdir/snapshot.js. const file = tmpdir.resolve('snapshot.js'); fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file); @@ -58,8 +57,7 @@ fs.appendFileSync(file, assert.strictEqual(child.status, 0); const result = fs.readFileSync(outPath, 'utf8'); - const expected = fs - .readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8') - .replace(/\r?\n/g, os.EOL); + const expected = fs.readFileSync( + fixtures.path('snapshot', 'ts-example.js'), 'utf8'); assert.strictEqual(result, expected); } From 6588b12081ca82274598e34d689cf3b3c60a314a Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:36:31 +0300 Subject: [PATCH 04/21] Revert "test: assert tests don't depend on core.autocrlf value" This reverts commit 158cd25b7c07e215ef1b304a5c773fa0055dfa3c. --- .github/workflows/coverage-windows.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 7c8323682f23..b282f03ccb7b 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -68,12 +68,8 @@ permissions: jobs: coverage-windows: if: github.event.pull_request.draft == false - strategy: - matrix: - autocrlf: [true, input, false] runs-on: windows-2025 steps: - - run: git config --global core.autocrlf ${{ matrix.autocrlf }} - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false From 5c5b989fd244ea9ec1a77c9202589a236a731bc7 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 4 May 2026 00:01:02 +0300 Subject: [PATCH 05/21] test: fix tests requiring git core.autocrlf=true on windows Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- test/README.md | 3 --- test/parallel/test-snapshot-typescript.js | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/README.md b/test/README.md index 02359ca68265..61f5b8bda918 100644 --- a/test/README.md +++ b/test/README.md @@ -8,9 +8,6 @@ directory, see [the guide on writing tests](../doc/contributing/writing-tests.md On how to run tests in this directory, see [the contributing guide](../doc/contributing/pull-requests.md#step-6-test). -For the tests to run on Windows, be sure to clone Node.js source code with the -`autocrlf` git config flag set to true. - ## Test Directories | Directory | Runs on CI | Purpose | diff --git a/test/parallel/test-snapshot-typescript.js b/test/parallel/test-snapshot-typescript.js index 98502ccebedf..bed1e1e79dfa 100644 --- a/test/parallel/test-snapshot-typescript.js +++ b/test/parallel/test-snapshot-typescript.js @@ -9,12 +9,13 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); const fs = require('fs'); +const os = require('os'); tmpdir.refresh(); const blobPath = tmpdir.resolve('snapshot.blob'); // Concat test/fixtures/snapshot/typescript.js with -// test/fixtures/snapshot/typescript.js into +// test/fixtures/snapshot/typescript-main.js into // tmpdir/snapshot.js. const file = tmpdir.resolve('snapshot.js'); fs.copyFileSync(fixtures.path('snapshot', 'typescript.js'), file); @@ -57,7 +58,8 @@ fs.appendFileSync(file, assert.strictEqual(child.status, 0); const result = fs.readFileSync(outPath, 'utf8'); - const expected = fs.readFileSync( - fixtures.path('snapshot', 'ts-example.js'), 'utf8'); + const expected = fs + .readFileSync(fixtures.path('snapshot', 'ts-example.js'), 'utf8') + .replace(/\r?\n/g, os.EOL); assert.strictEqual(result, expected); } From a6ee63f01c7a22c96609239dcca8482a54886059 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:37:58 +0300 Subject: [PATCH 06/21] test: move matrix job to a new testing workflow --- .github/workflows/test-windows.yml | 98 ++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/test-windows.yml diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml new file mode 100644 index 000000000000..0dcb5126e60d --- /dev/null +++ b/.github/workflows/test-windows.yml @@ -0,0 +1,98 @@ +name: Test Windows + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - .** + - '!.github/workflows/test-windows.yml' + push: + branches: + - main + paths-ignore: + - '**.md' + - '**.nix' + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - doc/** + - pyproject.yml + - tsconfig.json + - test/internet/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - .** + - '!.github/workflows/test-windows.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + PYTHON_VERSION: '3.14' + FLAKY_TESTS: keep_retrying + RUSTC_VERSION: '1.86' + +permissions: + contents: read + +jobs: + test-windows: + if: github.event.pull_request.draft == false + strategy: + matrix: + autocrlf: [true, false] + name: Windows tests (${{ matrix.autocrlf && 'with' || 'without' }} autocrlf) + runs-on: windows-2025 + steps: + - name: Set git config core.autocrlf + run: git config --global core.autocrlf ${{ matrix.autocrlf }} + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: ${{ env.PYTHON_VERSION }} + allow-prereleases: true + - name: Install deps + run: choco install nasm + - name: Install Rust ${{ env.RUSTC_VERSION }} + run: | + rustup override set "$RUSTC_VERSION" + rustup --version + - name: Build + run: ./vcbuild.bat clang-cl v8temporal + - name: Test + # run: python tools\test.py --mode=release -p tap --logfile test.tap default pummel' + # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed + run: python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" From c784c5523db56ed2b49b4b45bd1f607ed5b0610e Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:09:44 +0300 Subject: [PATCH 07/21] build tests before running --- .github/workflows/test-windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 0dcb5126e60d..4f9c9206e4be 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -93,6 +93,7 @@ jobs: - name: Build run: ./vcbuild.bat clang-cl v8temporal - name: Test - # run: python tools\test.py --mode=release -p tap --logfile test.tap default pummel' # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed - run: python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" + run: | + ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" From 97a494b073756b6378312c6a9c1573677512d31b Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 02:38:43 +0300 Subject: [PATCH 08/21] fix tests paths --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 4f9c9206e4be..a7059bc35189 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -96,4 +96,4 @@ jobs: # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed run: | ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests - python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="es-module/test-vm-source-text-module-leak,parallel/test-child-process-exec-any-shells-windows,parallel/test-inspector-wait-for-connection,parallel/test-util-getcallsites-sourcemap" + python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" From 8b75a9b2fc5627e22d4d0cab39e426307873d68a Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:32:06 +0300 Subject: [PATCH 09/21] diagnose issue --- .github/workflows/test-windows.yml | 12 +++++++++--- test/common/child_process.js | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a7059bc35189..4a52f7aafba1 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -92,8 +92,14 @@ jobs: rustup --version - name: Build run: ./vcbuild.bat clang-cl v8temporal + - name: build tests + run: ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + - name: check if embedtest.exe exists + run: Get-Item Release\embedtest.exe + - name: try running the exe manually + run: | + .\Release\embedtest.exe require("D:\\\\dev\\\\code\\\\node\\\\test\\\\fixtures\\\\exit.js") 92 + $LASTEXITCODE - name: Test # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed - run: | - ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests - python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" + run: python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" diff --git a/test/common/child_process.js b/test/common/child_process.js index c74154bb084f..82353052af3d 100644 --- a/test/common/child_process.js +++ b/test/common/child_process.js @@ -83,6 +83,10 @@ function expectSyncExit(caller, spawnArgs, { console.error(stderrStr === undefined ? (child.stderr?.toString() ?? '') : stderrStr); console.error(`${tag} --- stdout ---`); console.error(stdoutStr === undefined ? (child.stdout?.toString() ?? '') : stdoutStr); + // Print spawn/exec error if any (helps diagnose ENOENT / DLL load issues) + if (child.error) { + console.error(`${tag} spawn error: ${child.error.stack || child.error}`); + } console.error(`${tag} status = ${child.status}, signal = ${child.signal}`); const error = new Error(`${failures.join('\n')}`); From 80bbf51c5bf469d74fb04f68a76cf7222611f1fd Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 05:36:55 +0300 Subject: [PATCH 10/21] add cctest to build embedtest.exe --- .github/workflows/coverage-windows.yml | 2 +- .github/workflows/test-windows.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index b282f03ccb7b..a703d89c0656 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,7 +89,7 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' + run: ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests test-ci-js; node -e 'process.exit(0)' env: NODE_V8_COVERAGE: ./coverage/tmp - name: Report diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 4a52f7aafba1..066defe07ee7 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -91,15 +91,15 @@ jobs: rustup override set "$RUSTC_VERSION" rustup --version - name: Build - run: ./vcbuild.bat clang-cl v8temporal - - name: build tests - run: ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + run: ./vcbuild.bat clang-cl v8temporal cctest - name: check if embedtest.exe exists - run: Get-Item Release\embedtest.exe + run: try {Get-Item Release\embedtest.exe} catch {$_} - name: try running the exe manually run: | - .\Release\embedtest.exe require("D:\\\\dev\\\\code\\\\node\\\\test\\\\fixtures\\\\exit.js") 92 + try {.\Release\embedtest.exe require("D:\\\\dev\\\\code\\\\node\\\\test\\\\fixtures\\\\exit.js") 92} catch {$_} $LASTEXITCODE - name: Test - # change to ./vcbuild.bat noprojgen nobuild test-ci-js when the tests are fixed - run: python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" + # after the test is fixed change to ./vcbuild.bat noprojgen nobuild test test_npm + run: | + ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" From 2ef47e682cdceb6fc38b50d8f4975b9de088e233 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 4 May 2026 20:10:23 +0300 Subject: [PATCH 11/21] test: fix cp.exec-any-shells test on windows with wsl Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- .../test-child-process-exec-any-shells-windows.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 5c34bc77308c..38ee46e666fd 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -61,7 +61,14 @@ cp.exec('where bash', common.mustCall((error, stdout) => { const lines = stdout.trim().split(/[\r\n]+/g); for (let i = 0; i < lines.length; ++i) { const bashPath = lines[i].trim(); + const bashPathLower = bashPath.toLowerCase(); + + const isWSLBash = + bashPathLower.includes('windowsapps') || + bashPathLower.includes('\\system32\\bash.exe'); + test(bashPath); - testCopy(`bash_${i}.exe`, bashPath); + // Skip WSL bash (cannot be symlinked) + if (!isWSLBash) testCopy(`bash_${i}.exe`, bashPath); } })); From 3ec5f5881f4693852df4ba5c765fbe328d98e8b9 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 13:06:14 +0300 Subject: [PATCH 12/21] try all --- .github/workflows/coverage-windows.yml | 4 +++- .github/workflows/test-windows.yml | 13 ++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index a703d89c0656..93dfb55858b5 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,7 +89,9 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests test-ci-js; node -e 'process.exit(0)' + run: | + ./vcbuild.bat noprojgen nobuild build_ffi_tests + python tools\test.py --mode=release -p tap --logfile test.tap --flaky-tests=keep_retrying --measure-flakiness 9 default pummel; node -e 'process.exit(0)' env: NODE_V8_COVERAGE: ./coverage/tmp - name: Report diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 066defe07ee7..72c0d9ddbc8f 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -92,14 +92,9 @@ jobs: rustup --version - name: Build run: ./vcbuild.bat clang-cl v8temporal cctest - - name: check if embedtest.exe exists - run: try {Get-Item Release\embedtest.exe} catch {$_} - - name: try running the exe manually - run: | - try {.\Release\embedtest.exe require("D:\\\\dev\\\\code\\\\node\\\\test\\\\fixtures\\\\exit.js") 92} catch {$_} - $LASTEXITCODE - name: Test # after the test is fixed change to ./vcbuild.bat noprojgen nobuild test test_npm - run: | - ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests - python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" + #run: | + # ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + # python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" + run: ./vcbuild.bat noprojgen nobuild test test_npm From 49a0b56f1e6b9a445d1d6858db335f1f56c38f43 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 14:55:07 +0300 Subject: [PATCH 13/21] fix option spelling and disable coverage --- .github/workflows/coverage-windows.yml | 8 +++----- .github/workflows/test-windows.yml | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 93dfb55858b5..3ee4d84c6921 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,11 +89,9 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: | - ./vcbuild.bat noprojgen nobuild build_ffi_tests - python tools\test.py --mode=release -p tap --logfile test.tap --flaky-tests=keep_retrying --measure-flakiness 9 default pummel; node -e 'process.exit(0)' - env: - NODE_V8_COVERAGE: ./coverage/tmp + run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' + #env: + # NODE_V8_COVERAGE: ./coverage/tmp - name: Report run: npx c8 report env: diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 72c0d9ddbc8f..fab572825e1b 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -97,4 +97,4 @@ jobs: #run: | # ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests # python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" - run: ./vcbuild.bat noprojgen nobuild test test_npm + run: ./vcbuild.bat noprojgen nobuild test test-npm From 94904cca2d75013db15fa16823dc90bdd73fdc73 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 17:19:17 +0300 Subject: [PATCH 14/21] debug test-child-process-exec-any-shells-windows --- .github/workflows/coverage-windows.yml | 23 ++++++++++--------- ...t-child-process-exec-any-shells-windows.js | 3 +++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 3ee4d84c6921..d8f787805ba7 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,16 +89,17 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' + run: run: Release\node.exe test\parallel\test-child-process-exec-any-shells-windows.js + #run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' #env: # NODE_V8_COVERAGE: ./coverage/tmp - - name: Report - run: npx c8 report - env: - NODE_OPTIONS: --max-old-space-size=8192 - - name: Clean tmp - run: npx rimraf ./coverage/tmp - - name: Upload - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - with: - directory: ./coverage + #- name: Report + # run: npx c8 report + # env: + # NODE_OPTIONS: --max-old-space-size=8192 + #- name: Clean tmp + # run: npx rimraf ./coverage/tmp + #- name: Upload + # uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + # with: + # directory: ./coverage diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 38ee46e666fd..9344794bac25 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -16,6 +16,7 @@ const tmpPath = `${tmpdir.path}\\path with spaces`; fs.mkdirSync(tmpPath); const test = (shell) => { + console.log('Running test with shell:', shell); cp.exec('echo foo bar', { shell: shell }, common.mustSucceed((stdout, stderror) => { assert.ok(!stderror); @@ -23,9 +24,11 @@ const test = (shell) => { })); }; const testCopy = (shellName, shellPath) => { + console.log('Creating symlink:', shellName, '->', shellPath); // Symlink the executable to a path with spaces, to ensure there are no issues // related to quoting of argv0 const copyPath = `${tmpPath}\\${shellName}`; + console.log('Running testCopy with:', copyPath); fs.symlinkSync(shellPath, copyPath); test(copyPath); }; From 379512eadb1747cec388728acfc90b8c76df3717 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 17:21:26 +0300 Subject: [PATCH 15/21] trigger From 3f03d612a5bf85a05980479e08f81a3c3b0803f2 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 17:24:39 +0300 Subject: [PATCH 16/21] fix --- .github/workflows/coverage-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index d8f787805ba7..d36b6baf98c2 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,7 +89,7 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: run: Release\node.exe test\parallel\test-child-process-exec-any-shells-windows.js + run: Release\node.exe test\parallel\test-child-process-exec-any-shells-windows.js #run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' #env: # NODE_V8_COVERAGE: ./coverage/tmp From bf3a1596494f63952884b7f8dbbe66c968542060 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 22:10:43 +0300 Subject: [PATCH 17/21] skip wsl bash tests if wsl is not installed --- .github/workflows/coverage-windows.yml | 2 +- ...t-child-process-exec-any-shells-windows.js | 40 +++++++++++-------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index d36b6baf98c2..4eb93755b5c5 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,7 +89,7 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: Release\node.exe test\parallel\test-child-process-exec-any-shells-windows.js + run: Release/node.exe test/parallel/test-child-process-exec-any-shells-windows.js #run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' #env: # NODE_V8_COVERAGE: ./coverage/tmp diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 9344794bac25..25916c207c98 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -57,21 +57,29 @@ fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustSucceed(() => { })); // Test Bash (from WSL and Git), if available -cp.exec('where bash', common.mustCall((error, stdout) => { - if (error) { - return; - } - const lines = stdout.trim().split(/[\r\n]+/g); - for (let i = 0; i < lines.length; ++i) { - const bashPath = lines[i].trim(); - const bashPathLower = bashPath.toLowerCase(); +cp.exec('wsl.exe --version', (err) => { + const hasWSL = !err; - const isWSLBash = - bashPathLower.includes('windowsapps') || - bashPathLower.includes('\\system32\\bash.exe'); + cp.exec('where bash', common.mustCall((error, stdout) => { + if (error) return; - test(bashPath); - // Skip WSL bash (cannot be symlinked) - if (!isWSLBash) testCopy(`bash_${i}.exe`, bashPath); - } -})); + const lines = stdout.trim().split(/[\r\n]+/g); + + for (let i = 0; i < lines.length; ++i) { + const bashPath = lines[i].trim().replace(/^"+|"+$/g, ''); + const bashPathLower = bashPath.toLowerCase(); + + const isWSLBash = + bashPathLower.includes('windowsapps') || + bashPathLower.includes('\\system32\\bash.exe'); + + // Skip WSL bash tests if WSL is not installed + if (isWSLBash && !hasWSL) continue + + test(bashPath); + + // Skip symlink tests for WSL bash always + if (!isWSLBash) testCopy(`bash_${i}.exe`, bashPath); + } + })); +}); From 816b988c180b183603ba351312508a21e1703fe8 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Tue, 4 Aug 2026 23:47:45 +0300 Subject: [PATCH 18/21] skip wsl bash tests if no distro is installed --- .github/workflows/coverage-windows.yml | 2 +- test/common/child_process.js | 4 ---- .../test-child-process-exec-any-shells-windows.js | 9 +++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 4eb93755b5c5..0327498dc66e 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -82,7 +82,7 @@ jobs: run: choco install nasm - name: Install Rust ${{ env.RUSTC_VERSION }} run: | - rustup override set "$RUSTC_VERSION" + rustup override set ${{ env.RUSTC_VERSION }} rustup --version - name: Build run: ./vcbuild.bat clang-cl v8temporal diff --git a/test/common/child_process.js b/test/common/child_process.js index 82353052af3d..c74154bb084f 100644 --- a/test/common/child_process.js +++ b/test/common/child_process.js @@ -83,10 +83,6 @@ function expectSyncExit(caller, spawnArgs, { console.error(stderrStr === undefined ? (child.stderr?.toString() ?? '') : stderrStr); console.error(`${tag} --- stdout ---`); console.error(stdoutStr === undefined ? (child.stdout?.toString() ?? '') : stdoutStr); - // Print spawn/exec error if any (helps diagnose ENOENT / DLL load issues) - if (child.error) { - console.error(`${tag} spawn error: ${child.error.stack || child.error}`); - } console.error(`${tag} status = ${child.status}, signal = ${child.signal}`); const error = new Error(`${failures.join('\n')}`); diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 25916c207c98..0870a65cbc38 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -57,8 +57,8 @@ fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustSucceed(() => { })); // Test Bash (from WSL and Git), if available -cp.exec('wsl.exe --version', (err) => { - const hasWSL = !err; +cp.exec('wsl.exe -l -q', (err, stdout) => { + const hasWSLDistro = !err && stdout.trim().length > 0; cp.exec('where bash', common.mustCall((error, stdout) => { if (error) return; @@ -73,8 +73,9 @@ cp.exec('wsl.exe --version', (err) => { bashPathLower.includes('windowsapps') || bashPathLower.includes('\\system32\\bash.exe'); - // Skip WSL bash tests if WSL is not installed - if (isWSLBash && !hasWSL) continue + console.log({bashPath, isWSLBash, hasWSLDistro}); + // Skip WSL bash tests if no WSL distro is installed + if (isWSLBash && !hasWSLDistro) continue test(bashPath); From 44842dc999a24a8ad991b525280fbb3138b002f4 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Wed, 5 Aug 2026 01:43:12 +0300 Subject: [PATCH 19/21] semi-final test-windows --- .github/workflows/coverage-windows.yml | 27 +++++++++---------- .github/workflows/test-windows.yml | 6 ++--- ...t-child-process-exec-any-shells-windows.js | 24 +++++++---------- 3 files changed, 26 insertions(+), 31 deletions(-) diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 0327498dc66e..d79d2af23eea 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -89,17 +89,16 @@ jobs: # TODO(bcoe): investigate tests that fail with coverage enabled # on Windows. - name: Test - run: Release/node.exe test/parallel/test-child-process-exec-any-shells-windows.js - #run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' - #env: - # NODE_V8_COVERAGE: ./coverage/tmp - #- name: Report - # run: npx c8 report - # env: - # NODE_OPTIONS: --max-old-space-size=8192 - #- name: Clean tmp - # run: npx rimraf ./coverage/tmp - #- name: Upload - # uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - # with: - # directory: ./coverage + run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)' + env: + NODE_V8_COVERAGE: ./coverage/tmp + - name: Report + run: npx c8 report + env: + NODE_OPTIONS: --max-old-space-size=8192 + - name: Clean tmp + run: npx rimraf ./coverage/tmp + - name: Upload + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + directory: ./coverage diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index fab572825e1b..bb9b8e0c0191 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -88,13 +88,13 @@ jobs: run: choco install nasm - name: Install Rust ${{ env.RUSTC_VERSION }} run: | - rustup override set "$RUSTC_VERSION" + rustup override set ${{ env.RUSTC_VERSION }} rustup --version - name: Build run: ./vcbuild.bat clang-cl v8temporal cctest - name: Test - # after the test is fixed change to ./vcbuild.bat noprojgen nobuild test test_npm + # after the test "test-child-process-exec-any-shells-windows" is fixed change to ./vcbuild.bat noprojgen nobuild test + run: ./vcbuild.bat noprojgen nobuild test #run: | # ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests # python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" - run: ./vcbuild.bat noprojgen nobuild test test-npm diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 0870a65cbc38..553142c3db7b 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -16,7 +16,6 @@ const tmpPath = `${tmpdir.path}\\path with spaces`; fs.mkdirSync(tmpPath); const test = (shell) => { - console.log('Running test with shell:', shell); cp.exec('echo foo bar', { shell: shell }, common.mustSucceed((stdout, stderror) => { assert.ok(!stderror); @@ -24,11 +23,9 @@ const test = (shell) => { })); }; const testCopy = (shellName, shellPath) => { - console.log('Creating symlink:', shellName, '->', shellPath); // Symlink the executable to a path with spaces, to ensure there are no issues // related to quoting of argv0 const copyPath = `${tmpPath}\\${shellName}`; - console.log('Running testCopy with:', copyPath); fs.symlinkSync(shellPath, copyPath); test(copyPath); }; @@ -57,13 +54,13 @@ fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustSucceed(() => { })); // Test Bash (from WSL and Git), if available -cp.exec('wsl.exe -l -q', (err, stdout) => { - const hasWSLDistro = !err && stdout.trim().length > 0; - - cp.exec('where bash', common.mustCall((error, stdout) => { - if (error) return; - - const lines = stdout.trim().split(/[\r\n]+/g); +cp.exec('where bash', common.mustCall((error, stdout) => { + if (error) return; + + const lines = stdout.trim().split(/[\r\n]+/g); + + cp.exec('wsl.exe -l -q', (err, out) => { + const hasWSLDistro = !err && out.trim().length > 0; for (let i = 0; i < lines.length; ++i) { const bashPath = lines[i].trim().replace(/^"+|"+$/g, ''); @@ -73,14 +70,13 @@ cp.exec('wsl.exe -l -q', (err, stdout) => { bashPathLower.includes('windowsapps') || bashPathLower.includes('\\system32\\bash.exe'); - console.log({bashPath, isWSLBash, hasWSLDistro}); // Skip WSL bash tests if no WSL distro is installed - if (isWSLBash && !hasWSLDistro) continue + if (isWSLBash && !hasWSLDistro) continue; test(bashPath); // Skip symlink tests for WSL bash always if (!isWSLBash) testCopy(`bash_${i}.exe`, bashPath); } - })); -}); + }); +})); From 2cbd834e8710030a7197759e5a7fadd045d9e2de Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:39:42 +0300 Subject: [PATCH 20/21] almost final test-windows --- test/parallel/test-child-process-exec-any-shells-windows.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 553142c3db7b..37fa957f2c7b 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -56,9 +56,9 @@ fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustSucceed(() => { // Test Bash (from WSL and Git), if available cp.exec('where bash', common.mustCall((error, stdout) => { if (error) return; - + const lines = stdout.trim().split(/[\r\n]+/g); - + cp.exec('wsl.exe -l -q', (err, out) => { const hasWSLDistro = !err && out.trim().length > 0; From 2d60b41ad98822ece6f90857cd67c158606fca27 Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Wed, 5 Aug 2026 18:59:42 +0300 Subject: [PATCH 21/21] final test-windows --- .github/workflows/test-windows.yml | 9 ++++----- .../test-child-process-exec-any-shells-windows.js | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index bb9b8e0c0191..30a48c13b81f 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -93,8 +93,7 @@ jobs: - name: Build run: ./vcbuild.bat clang-cl v8temporal cctest - name: Test - # after the test "test-child-process-exec-any-shells-windows" is fixed change to ./vcbuild.bat noprojgen nobuild test - run: ./vcbuild.bat noprojgen nobuild test - #run: | - # ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests - # python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" + # after the test "test-child-process-exec-any-shells-windows" is fixed change to `./vcbuild.bat noprojgen nobuild test` + run: | + ./vcbuild.bat noprojgen nobuild build-addons build-js-native-api-tests build-node-api-tests build-ffi-tests + python3 tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=keep_retrying --measure-flakiness 9 default pummel addons ffi js-native-api node-api embedding benchmark --skip-tests="test-child-process-exec-any-shells-windows" diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 37fa957f2c7b..6a9714e39bd2 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -55,8 +55,9 @@ fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustSucceed(() => { // Test Bash (from WSL and Git), if available cp.exec('where bash', common.mustCall((error, stdout) => { - if (error) return; - + if (error) { + return; + } const lines = stdout.trim().split(/[\r\n]+/g); cp.exec('wsl.exe -l -q', (err, out) => {