Skip to content

Markdownlint error: spawnSync markdownlint ENOENT #43

@romainf-ubi

Description

@romainf-ubi

I have a bug with Linter and Markdownlint.

I'm on Windows and I've installed Markdownlint using npm install -g markdownlint-cli, but I get this error:

Error while running "markdownlint": spawnSync markdownlint ENOENT

I restarted my machine, just in case, but same error.

Here's the whole output (regarding markdownlint, not the other linters, which are not installed anyway):

Linter config: {
  "capabilities": [
    "fix-inline"
  ],
  "command": [
    "markdownlint",
    "--json",
    [
      "$fixAll",
      "--fix"
    ],
    [
      "$config",
      "--config",
      "$config"
    ],
    "--stdin"
  ],
  "configFiles": [
    ".markdownlint.json",
    ".markdownlint.yaml",
    ".markdownlint.yml",
    ".markdownlintrc"
  ],
  "enabled": true,
  "languages": [
    "markdown"
  ],
  "name": "markdownlint",
  "url": "https://github.com/DavidAnson/markdownlint"
}
Args: {
  "$rootDir": "c:\\path\\to\\root\\dir",
  "$file": "/c:/path/to/file.md",
  "$extension": ".md",
  "$extensionBare": "md",
  "$config": "",
  "$debug": false,
  "$lint": true,
  "$language": "markdown",
  "$shebang": ""
}
{
  "rootDir": "c:\\path\\to\\root\\dir",
  "configFile": "",
  "command": [
    "markdownlint",
    "--json",
    "--stdin"
  ]
}
Error while running "markdownlint": spawnSync markdownlint ENOENT
markdownlint's command took 4ms

(I only edited the paths for privacy reasons)

I used cmd to run markdownlint --json --stdin < c:/path/to/file.md (without the leading / in the file path), and it worked as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions