markdown-pdf: The "file" argument must be of type string. Received type object
Hi,
When I run markdown-pdf README.md
I get the following error:
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
at validateString (internal/validators.js:125:11)
at normalizeSpawnArguments (child_process.js:414:3)
at spawn (child_process.js:553:16)
at Object.execFile (child_process.js:224:15)
at WriteStream.<anonymous> (/usr/local/lib/node_modules/markdown-pdf/index.js:117:22)
at WriteStream.emit (events.js:202:15)
at finishMaybe (_stream_writable.js:646:14)
at stream._final (_stream_writable.js:624:5)
at WriteStream._final (internal/fs/streams.js:270:3)
at callFinal (_stream_writable.js:617:10)
Can anyone suggest any solution?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 49
- Comments: 22
Commits related to this issue
- Don't ignore scripts Don't ignore scripts, suggests https://github.com/alanshaw/markdown-pdf/issues/159 — committed to vielmetti/glossary by vielmetti 5 years ago
I get the same with node 11.11.0. Reinstall without
--ignore-scripts
option and worked fine.better to do:
Thanks for the
--ignore-scripts
tip!Anyone else experiencing this issue, don’t forget the
-g
flag innpm uninstall -g markdown-pdf
like I did, because the issue may persist.After remembering the
-g
flag and re-installing markdown-pdf (without--ignore-scripts
) it found a missing dependency in PhantomJS and installed it.Now I’m having a separate error from PhantomJS about libssl and a missing shared object file. On to the next one! It’s worth it because I love being able to write reports in markdown and turn them into shiny PDF’s for the boss man. Thank you!
I think the install instructions need to be changed. I had the same issue on Windows 7, until I uninstalled and then re-installed without the --ignore-scripts
Perhaps this is a Windows specific problem, in which case there should be Windows specific install instructions
Hi! no luck on Ubuntu 19.04, node v10.15.2 or v11.15.0
Uninstalled with
sudo npm uninstall -g markdown-pdf
Installed it with:sudo npm install -g markdown-pdf --ignore-scripts
Doing:
markdown-pdf doc.md
outputs:Thank you 😃
Edit: worked fined if not installed globally!
node v10.14.2 Uninstall and install again without
--ignore-scripts
resolved the issue for me as well.Thank you, It worked like a charm.
Can’t repro… 😕
This works for me:
Also works with markdown-pdf globally installed.
Version deets:
That’s here. Looks like
childArgs
contains something nonsensical for some reason, andchildProcess.execFile
throws.Could one of you add a
console.log(childArgs)
before that line, so we find the culprit?