Skip to content

throws "wmic ENOENT" when running vivliostyle preview #765

@h-takeyeah

Description

@h-takeyeah

environments

  • locale: ja-JP
  • OS: Microsoft Windows 11 (Home edition)
  • node: 24.14.0
  • npm: 11.9.0
  • @vivliostyle/cli: 10.3.1

issue

When running vivliostyle preview, it throws "wmic ENOENT" error.

> npx vivliostyle preview

INFO Start preview
ERROR Error: spawn wmic ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

If you think this is a bug, please report at https://github.com/vivliostyle/vivliostyle-cli/issues

notes

The program wmic.exe is called here and may cause the issue:

const { stdout } = await exec('wmic', ['os', 'get', 'locale']);

In addition to this, the error can be reproduced by running npm create book (I attached the log). I understand that reporting this issue in this repository is not appropriate, however I'm reporting it just in case.

On my another computer (Windows 11 Pro) which has wmic.exe, both of those commands (vivliostyle preview and npm create book) worked as expected.


This is the log of npm create book.

~\Documents  npm create book
Need to install the following packages:
create-book@10.3.1
Ok to proceed? (y) y

> npx
> create-book

║
◆─ Where should we create your project?
◇─ Where should we create your project?
║  helloworld
║
◆─ What's the title of your publication?
◇─ What's the title of your publication?
║  Helloworld
║
◆─ What's the author name?
◇─ What's the author name?
║  My Name
ERROR Error: spawn wmic ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

If you think this is a bug, please report at https://github.com/vivliostyle/vivliostyle-cli/issues
npm error code 1
npm error path C:\Users\xxxxxxxx\Documents
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c create-book
npm error A complete log of this run can be found in: C:\Users\xxxxxxxx\AppData\Local\npm-cache\_logs\2026-03-24T11_37_51_248Z-debug-0.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions