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

TypeError: Bad argument #112

Open
mdeforge opened this issue Dec 22, 2016 · 3 comments
Open

TypeError: Bad argument #112

mdeforge opened this issue Dec 22, 2016 · 3 comments
Labels

Comments

@mdeforge
Copy link

When I do "markdown-pdf -o test.pdf test.md", I get this.

TypeError: Bad argument
at TypeError (native)
at ChildProcess.spawn (internal/child_process.js:289:26)
at exports.spawn (child_process.js:380:9)
at Object.exports.execFile (child_process.js:143:15)
at WriteStream. (C:\Program Files\nodejs\node_modules\markdown-pdf\index.js:117:22)
at emitNone (events.js:91:20)
at WriteStream.emit (events.js:185:7)
at finishMaybe (_stream_writable.js:515:14)
at endWritable (_stream_writable.js:525:3)
at WriteStream.Writable.end (_stream_writable.js:490:5)

Granted, I used npmbox to build an offline installer for this. But if I'm missing something, I'd really like to know what. Don't deal with node.js and npm stuff everyday. Any clues would be helpful.

@ibaned
Copy link

ibaned commented Mar 1, 2017

I installed markdown-pdf by first installing NPM via the Mac OS package on their website, and then simply running

npm install markdown-pdf

I also get a similar error:

(node:74342) Warning: Possible EventEmitter memory leak detected. 2 end listeners added. Use emitter.setMaxListeners() to increase limit
internal/child_process.js:289
  var err = this._handle.spawn(options);
                         ^

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.execFile (child_process.js:143:15)
    at WriteStream.<anonymous> (/Users/daibane/src/omega_h/doc/node_modules/markdown-pdf/index.js:117:22)
    at emitNone (events.js:91:20)
    at WriteStream.emit (events.js:185:7)
    at finishMaybe (_stream_writable.js:515:14)
    at afterWrite (_stream_writable.js:389:3)
    at onwrite (_stream_writable.js:379:7)

@anko
Copy link
Collaborator

anko commented May 16, 2017

Having trouble reproducing this. This works for me:

$ uname
Linux
$ node --version
v7.10.0
$ cd $(mktemp --dir)
$ npm i markdown-pdf
[ ... npm output ... ]
$ ./node_modules/.bin/markdown-pdf -o test.pdf <(echo '# hi')
[ ... markdown-pdf output ... ]

@mdeforge Are you also on Mac OS?

@renhongxu123
Copy link

Hey folks, I met the same trouble on MacOS, and I find this

markdown-pdf requires phantomjs-prebuilt
Medium/phantomjs#533

And it works for me

@anko anko added the bug label Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants