marp-cli icon indicating copy to clipboard operation
marp-cli copied to clipboard

Inside folder gives: Not found processable Markdown file(s).

Open kevinsimper opened this issue 6 months ago • 3 comments

Version of Marp Tool

@marp-team/marp-cli v4.2.0 (w/ @marp-team/marp-core v4.1.0)

Operating System

macOS

Environment

  • OS version: macos
  • Node.js version (Marpit / Marp Core/ Marp CLI): v23.10.0

How to reproduce

this works:

cd .. && npx @marp-team/marp-cli deck/deck.md --pdf -o deck/deck.pdf

this does not work

npx @marp-team/marp-cli deck.md --pdf -o deck.pdf

Expected behavior

That it can find files inside the folder, not having to go a folder up.

Actual behavior

It can not find files in the current folder.

Additional information

No response

kevinsimper avatar Jun 20 '25 14:06 kevinsimper

I could not reproduce it. If a path to a Markdown file was given like following, both commands are working for me. Try to confirm the current directory before running Marp (e.g. pwd).

/Users/yhatt/Documents/marp
└── deck
    └── deck.md
$ pwd
/Users/yhatt/Documents/marp/deck

$ npx @marp-team/marp-cli deck.md --pdf -o deck.pdf
[  INFO ] Converting 1 markdown...
[  INFO ] deck.md => deck.pdf

$ pwd
/Users/yhatt/Documents/marp/deck

$ cd .. && npx @marp-team/marp-cli deck/deck.md --pdf -o deck/deck.pdf
[  INFO ] Converting 1 markdown...
[  INFO ] deck/deck.md => deck/deck.pdf

yhatt avatar Jun 20 '25 15:06 yhatt

@yhatt I tried reproducing outside the repo I was working in and it works:

$ pwd
/Users/kevinsimper/projects/test/testmarp
$ ls deck
mydeck.md
$ cat deck/mydeck.md
# Hello World
$ npx @marp-team/marp-cli -v
@marp-team/marp-cli v4.2.0 (w/ @marp-team/marp-core v4.1.0)
$ node -v
v23.10.0
$ npx @marp-team/marp-cli deck/mydeck.md --pdf -o deck/mydeck.pdf
[  INFO ] Converting 1 markdown...
[  INFO ] deck/mydeck.md => deck/mydeck.pdf
$ cd deck
$ npx @marp-team/marp-cli mydeck.md --pdf -o mydeck.pdf
[  INFO ] Converting 1 markdown...
[  INFO ] mydeck.md => mydeck.pdf

So it has to be because I am running it inside a npm workspace, and there is a bug somewhere in a dependency.

# Inside npm workspace
$ npx @marp-team/marp-cli deck.md --pdf -o deck.pdf
[  WARN ] Not found processable Markdown file(s).

I will just continue with the deck/deck.md which works inside my npm workspace, I just wanted to highlight it if others were also experiencing this 💛

kevinsimper avatar Jun 20 '25 15:06 kevinsimper

npx is historically an alias for npm exec, and it has the first-level support for npm workspaces since npm v7. When running Marp CLI via npx within npm workspaces, certainly process.cwd() seems to be bound to the workspace root.

According to the documentation of npm, you can add --workspaces=false option for npx to disable npm workspaces support explicitly. Now npx should run in the current working directory as you've expected. https://docs.npmjs.com/cli/v11/commands/npm-exec#workspaces

npx --workspaces=false @marp-team/marp-cli deck.md --pdf -o deck.pdf

yhatt avatar Jun 20 '25 17:06 yhatt

I believe it was resolved by https://github.com/marp-team/marp-cli/issues/668#issuecomment-2992310951, but feel free to reopen if you still have met an issue. 😎

yhatt avatar Aug 03 '25 06:08 yhatt