Skip to content

Instantly share code, notes, and snippets.

@paulrobertlloyd
Last active March 25, 2020 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulrobertlloyd/7f345b962e150bd4b974acfa2ba93d0d to your computer and use it in GitHub Desktop.
Save paulrobertlloyd/7f345b962e150bd4b974acfa2ba93d0d to your computer and use it in GitHub Desktop.
Different result via npm script and npx

If I use the following npm script:

"scripts": {
  "lint:markdown": "markdownlint app/**/*.md",
},

and run npm run lint:markdown, the glob only finds 5 files.

However, if I run the same command via npx, e.g. npx markdownlint app/**/*.md, glob correctly finds 287 files.

I’ve added logging to the executable in node_modules/bin/markdownlint, and both commands display this logging, to the same executable is being run. WTF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment