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

internal/validators.js:118 #181

Open
isomorphisms opened this issue Jan 16, 2020 · 3 comments
Open

internal/validators.js:118 #181

isomorphisms opened this issue Jan 16, 2020 · 3 comments

Comments

@isomorphisms
Copy link

    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'
}```
@kingzbauer
Copy link

It seems that you have to specify the path to phantomjs binary. markdown-pdf -p $(which phantomjs) mymarkdown.md

@jandroalvarez
Copy link

I have the same issue.
I have installed phantomjs using npm as follows:
npm install phantomjs -g
It has been installed at /usr/local/bin/phantomjs

What is the path expected by phantomjs module to avoid specifying its path as markdown-pdf option?

@jandroalvarez
Copy link

jandroalvarez commented Apr 17, 2020

I've realized that phantomjs npm package is deprecated. After uninstalling it and installing globally phantomjs-prebuilt the issue has been fixed.

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

3 participants