Skip to content

Windows cached tasks can skip Node CLI execution through PowerShell package shims #365

@SegaraRai

Description

@SegaraRai

Summary

On Windows, a cached task that runs a package binary through the package-manager shim can complete without running the underlying Node CLI.

This appears to be exposed by the Windows .cmd shim to PowerShell .ps1 rewrite added in #345. The repro uses a local package binary and shows that direct Node invocation works while the cached PowerShell shim path does not.

Reproduction

Minimal repro:

https://github.com/SegaraRai/vitetask-repro05

GitHub Actions run showing Linux passing and Windows failing:

https://github.com/SegaraRai/vitetask-repro05/actions/runs/25041476175

The repro defines a local package binary, marker-cli. It does two things:

  • prints MARKER_STDOUT:<label> to stdout
  • writes .markers/<label>.json

This distinguishes stdout capture failures from the CLI not running at all.

The task config is:

export default defineConfig({
  run: {
    tasks: {
      "shim:cached": {
        command: "marker-cli shim-cached",
        cache: true,
      },
      "node:cached": {
        command: "node ./packages/marker-cli/bin/marker-cli.mjs node-cached",
        cache: true,
      },
      "shim:uncached": {
        command: "marker-cli shim-uncached",
        cache: false,
      },
    },
  },
});

Manual steps:

vp install

Remove-Item .markers -Recurse -Force -ErrorAction SilentlyContinue
vp cache clean
vp run shim:uncached
Get-Content .markers/shim-uncached.json

Remove-Item .markers -Recurse -Force -ErrorAction SilentlyContinue
vp cache clean
vp run node:cached
Get-Content .markers/node-cached.json

Remove-Item .markers -Recurse -Force -ErrorAction SilentlyContinue
vp cache clean
vp run shim:cached
Get-Content .markers/shim-cached.json

Expected behavior

On Windows, vp run shim:cached should run the package binary and produce both:

MARKER_STDOUT:shim-cached

and:

.markers/shim-cached.json

Actual behavior

On Windows, vp run shim:cached logs the task command:

$ marker-cli shim-cached

but does not print:

MARKER_STDOUT:shim-cached

and does not create:

.markers/shim-cached.json

The following control cases both work on Windows:

  • marker-cli shim-uncached with cache: false
  • node ./packages/marker-cli/bin/marker-cli.mjs node-cached with cache: true

The same workflow passes on Linux.

Related symptom / search keywords

In the original project where this was first noticed, the same Windows cached package-shim path sometimes opened a new terminal window and showed this process start error:

Error 2147942632 (0x800700e8) occurred while starting "<node.exe>" "<package cli js>"

The localized Windows message looked like:

'"C:\...\node.exe" C:\...\node_modules\.bin/../<package>/bin.js ...' の起動時にエラー 2147942632 (0x800700e8) が発生しました

Search keywords: 2147942632, 0x800700e8, node.exe, node_modules\.bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions