Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdownlint error: spawnSync markdownlint ENOENT #43

Open
romainf-ubi opened this issue Jan 5, 2024 · 1 comment
Open

Markdownlint error: spawnSync markdownlint ENOENT #43

romainf-ubi opened this issue Jan 5, 2024 · 1 comment

Comments

@romainf-ubi
Copy link

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.

@romainf-ubi romainf-ubi changed the title Markdownlint: getting spawnSync markdownlint ENOENT Markdownlint error: spawnSync markdownlint ENOENT Jan 5, 2024
@romainf-ubi
Copy link
Author

Apparently ENOENT means "ENOENT No such file or directory (POSIX.1-2001)" (source: https://www.man7.org/linux/man-pages/man3/errno.3.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant