question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to properly invoke markdown-pdf

See original GitHub issue

Hello, just updated and tried to use it again with very simple invocation:

markdown-pdf doc.md

I expected a doc.pdf to be created. Instead I got the following error message:

internal/validators.js:118
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null
    at validateString (internal/validators.js:118:11)
    at normalizeSpawnArguments (child_process.js:406:3)
    at spawn (child_process.js:546:13)
    at Object.execFile (child_process.js:232:17)
    at WriteStream.<anonymous> (/usr/local/lib/node_modules/markdown-pdf/index.js:117:22)
    at WriteStream.emit (events.js:333:22)
    at finishMaybe (_stream_writable.js:697:14)
    at _stream_writable.js:673:7
    at WriteStream._final (internal/fs/streams.js:377:3)
    at callFinal (_stream_writable.js:666:10) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Aside it created an empty doc.pdf file, also indicating that it’s not a permission issue on my system. I am using macOS Catalina.

Cheers, Florian

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:13
  • Comments:12

github_iconTop GitHub Comments

3reactions
JRMeyercommented, Apr 11, 2020

This answer from #181 worked for me on Ubuntu 18.04:

markdown-pdf -p $(which phantomjs) mymarkdown.md

2reactions
dijitaltrixcommented, Mar 29, 2020

Same issue here on macos Mojave 10.14.6, I tried markdown-pdf v9.0.0 and v10.0.0

$ markdown-pdf readme.md 
$ markdown-pdf -c ./ readme.md

Same error but line 117

internal/validators.js:117
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null
    at validateString (internal/validators.js:117:11)
    at normalizeSpawnArguments (child_process.js:406:3)
    at spawn (child_process.js:542:16)
    at Object.execFile (child_process.js:232:17)
    at WriteStream.<anonymous> (/opt/local/lib/node_modules/markdown-pdf/index.js:117:22)
    at WriteStream.emit (events.js:333:22)
    at finishMaybe (_stream_writable.js:687:14)
    at _stream_writable.js:664:5
    at WriteStream._final (internal/fs/streams.js:311:3)
    at callFinal (_stream_writable.js:657:10) {
  code: 'ERR_INVALID_ARG_TYPE'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Unable to properly invoke markdown-pdf -
Hello, just updated and tried to use it again with very simple invocation: markdown-pdf doc.md. I expected a doc.pdf to be created.
Read more >
Unable to export to pdf from markdown · Issue #166 - GitHub
I dont know much about this stuff, im using VS code for a project and im facing a problem while converting the markdown...
Read more >
"Couldn't load plugin" when calling knitr::include_graphics ...
am trying to include a pdf-graphic with r-markdown. Oddly, the output with Pandoc to pdf works flawlessly. The html output writes Couldn't ...
Read more >
R Markdown with \newif fails to compile to pdf after update
Thanks. Actually, I do now have a workaround: configure RStudio to use panic 2.13. Then all my files compile correctly without problems ( ......
Read more >
15 Common Problems with rmarkdown (and some solutions)
Develop code in chunks and execute the chunks until they work, then move on. ... render_args, render_meta) : Failed to compile common-problems.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found