Skip to content

Markdown lint fails when having spaces in path #20538

Description

@jlaur

I'm getting this error on mvn clean install from a path having spaces in it:

[INFO] Running 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config C:\Users\Jacob Laursen\Development\jlaur\openhab-addons/.github/markdownlint.yaml' in C:\Users\Jacob Laursen\Development\jlaur\openhab-addons\bundles\org.openhab.automation.pidcontroller
[INFO] markdownlint-cli2 v0.22.0 (markdownlint v0.40.0)
[INFO] Error: Unable to use configuration file 'C:/Users/Jacob'; Configuration file should be one of the supported names (e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name (e.g., 'example.markdownlint-cli2.jsonc') or have a supported extension (e.g., jsonc, json, yaml, yml, cjs, mjs).
[INFO]     at throwForConfigurationFile (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
[INFO]     at readOptionsOrConfig (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
[INFO]     at main (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:926:27)
[INFO]     ... 3 lines matching cause stack trace ...
[INFO]     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
[INFO]   [cause]: Error: Configuration file should be one of the supported names (e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name (e.g., 'example.markdownlint-cli2.jsonc') or have a supported extension (e.g., jsonc, json, yaml, yml, cjs, mjs).
[INFO]       at readOptionsOrConfig (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:161:13)
[INFO]       at main (file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:926:27)
[INFO]       at file:///C:/Users/Jacob%20Laursen/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:28
[INFO]       at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
[INFO]       at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
[INFO]       at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  58.721 s
[INFO] Finished at: 2026-04-02T18:45:25+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:2.0.0:npm (markdownlint) on project org.openhab.automation.pidcontroller: Failed to run task: 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config C:\Users\Jacob Laursen\Development\jlaur\openhab-addons/.github/markdownlint.yaml' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]

This is a regression of #19010.

Expected Behavior

Being able to build.

Current Behavior

See above.

Possible Solution

Unfortunately my attempt to fix it failed: #20503, which is why I've created this issue instead.

I don't know how to proceed.

Steps to Reproduce (for Bugs)

Place the repo in a path containing at least one space.

Context

Currently I have to use the fix from #20503 locally to be able to build. This is is cumbersome to upkeep when switching between branches, staging files for commits, etc.

Your Environment

  • Version used: 5.2
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...):
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructureBuild system and Karaf related issues and PRs

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions