markdown-pdf icon indicating copy to clipboard operation
markdown-pdf copied to clipboard

Won't work - just errors.

Open virtualdreams opened this issue 7 years ago • 9 comments

nodejs 10.9.0

> npm install -g markdown-pdf
> markdown-pdf test.md
internal/validators.js:125
    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:394:3)
    at spawn (child_process.js:519:38)
    at Object.execFile (child_process.js:216:15)
    at WriteStream.<anonymous> (C:\Users\username\AppData\Roaming\npm\node_modules\markdown-pdf\index.js:117:22)
    at WriteStream.emit (events.js:187:15)
    at finishMaybe (_stream_writable.js:641:14)
    at stream._final (_stream_writable.js:619:5)
    at WriteStream._final (internal/fs/streams.js:264:3)
    at callFinal (_stream_writable.js:612:10)

virtualdreams avatar Aug 16 '18 09:08 virtualdreams

I'm OK with node v10.9.0, but I'm using Ubuntu 16.04.2 LTS (64-bit)

zhang-ray avatar Aug 27 '18 02:08 zhang-ray

What is the solution then ? I get this with node v11.9.0 and npm v6.7.0, I'm on arch linux (antergos).

Krasnoiark avatar Feb 06 '19 17:02 Krasnoiark

I get similar errors:

nodejs v11.9.0

internal/validators.js:125
    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)

nodejs v8.15.0

(node:13328) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 2 end listeners added. Use emitter.setMaxListeners() to increase limit
child_process.js:389
    throw new TypeError('"file" argument must be a non-empty string');
    ^

TypeError: "file" argument must be a non-empty string
    at normalizeSpawnArguments (child_process.js:389:11)
    at exports.spawn (child_process.js:502:38)
    at Object.exports.execFile (child_process.js:218:15)
    at WriteStream.<anonymous> (/usr/local/lib/node_modules/markdown-pdf/index.js:117:22)
    at emitNone (events.js:111:20)
    at WriteStream.emit (events.js:208:7)
    at finishMaybe (_stream_writable.js:613:14)
    at afterWrite (_stream_writable.js:464:3)
    at onwrite (_stream_writable.js:454:7)
    at fs.write (fs.js:2194:5)

bronzehedwick avatar Feb 18 '19 18:02 bronzehedwick

I'm experiencing the same problem on Mac OS X with node 11.9.0.

ludwiktrammer avatar Feb 26 '19 13:02 ludwiktrammer

Same problem here, nodejs v11.10.0 on Arch:

$ markdown-pdf test.md 
internal/validators.js:125
    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/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)

phuctvt avatar Mar 03 '19 13:03 phuctvt

same here. duplicate of #142.

pille avatar Mar 20 '19 11:03 pille

Uninstall and reinstall without --ignore-scripts. It fixed the problem for me

AlbertoMontalesi avatar Mar 22 '19 09:03 AlbertoMontalesi

I tried uninstalling and then reinstalling without --ignore-scripts as suggested above, but I got the same error.

bronzehedwick avatar Mar 25 '19 13:03 bronzehedwick

Installing locally (no -g) without the --ignore-scripts worked for me, on Ubuntu 18.04, node v8.16.0.

./node_modules/markdown-pdf/bin/markdown-pdf document.md

jgrocha avatar Mar 10 '20 23:03 jgrocha