question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Command cli: '"file" argument must be a non-empty string'

See original GitHub issue

Hi: When I run markdown-pdf -o test.pdf test.md Give me this error:

(node:7924) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 2 end listeners added. Use emitter.setMaxListeners() to increase limit
child_process.js:383
    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:383:11)
    at exports.spawn (child_process.js:496:38)
    at Object.exports.execFile (child_process.js:212:15)
    at WriteStream.<anonymous> (/usr/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:614:14)
    at afterWrite (_stream_writable.js:465:3)
    at onwrite (_stream_writable.js:455:7)
    at fs.write (fs.js:2192:5)

I tried the inverse form: markdown-pdf -o test.md test.pdf but:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'prueba.pdf'

Thanks for advanced.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

1reaction
gtheraudcommented, Jun 13, 2019

With node v8.16.0, i got the same issue. I guess it’s related to https://github.com/nodejs/node/issues/19235

It happens if opts.phantomPath is undefined. I runned npm install -g phantomjs-prebuild and used the --phantom-path parameter and it fixed the issue.

0reactions
atempelcommented, Nov 23, 2020

With node v8.16.0, i got the same issue. I guess it’s related to nodejs/node#19235

It happens if opts.phantomPath is undefined. I runned npm install -g phantomjs-prebuild and used the --phantom-path parameter and it fixed the issue.

Just a correction, the package name I found was phantomjs-prebuilt making the line npm install -g phantomjs-prebuilt

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting "TypeError: file argument must be a non-empty string ...
I'm sure I am missing something, but this one feels like it's a bug within the Cordova Build extension. FYI Node: 8.9.1, NPM:...
Read more >
Empty string breaks command line - Unix Stack Exchange
The ls utility does not like an empty argument because there is no file or directory that has an empty name. – Kusalananda...
Read more >
xargs - Construct an argument list and run a command - IBM
The placeholder following the -I is a string that can appear multiple times in the command template. xargs strips the input line of...
Read more >
argparse — Parser for command-line options, arguments and ...
All it does is convert empty strings to False and non-empty strings to True . This is usually not what is desired. In...
Read more >
picocli - a mighty tiny command line interface
The file may itself contain additional @-file arguments; any such arguments will be processed recursively. If the file does not exist, or cannot ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found