markdown-pdf
markdown-pdf copied to clipboard
Won't work - just errors.
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)
I'm OK with node v10.9.0, but I'm using Ubuntu 16.04.2 LTS (64-bit)
What is the solution then ? I get this with node v11.9.0 and npm v6.7.0, I'm on arch linux (antergos).
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)
I'm experiencing the same problem on Mac OS X with node 11.9.0.
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)
same here. duplicate of #142.
Uninstall and reinstall without --ignore-scripts. It fixed the problem for me
I tried uninstalling and then reinstalling without --ignore-scripts as suggested above, but I got the same error.
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