-
Notifications
You must be signed in to change notification settings - Fork 255
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 [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null #210
Comments
Having a similar error, I found that the code is not able to locate a phantomjs. So installing |
Installing |
I can confirm that the solution by @ZloeSabo did not help in my case either. I'm a Node newbie, but here's the reproducible example (running on Docker image
which yields
Glad to try and help with debugging, but I'm normally useless on Node. System:
|
It worked for me after installing Example:
|
Getting this error
and it is still not working. |
I added
and I no longer have errors. |
I had to supply both: OPENSSL_CONF=/etc/ssl markdown-pdf \
--phantom-path "${NODE_MODULES_DIR}/phantomjs-prebuilt/lib/phantom/bin/phantomjs" \
--out test.pdf
README.md |
The reason can't find file is markdown-pdf index.js line 17 opts.phantomPath = opts.phantomPath || require('phantomjs-prebuilt').path system can't find path by require function So we intall the phantomjs-prebuilt by npm install phantomjs-prebuilt /**
* Where the phantom binary can be found.
* @type {string}
*/
try {
var location = require('./location')
exports.path = path.resolve(__dirname, location.location)
exports.platform = location.platform
exports.arch = location.arch
} catch(e) {
// Must be running inside install script.
exports.path = null
} We can see if the code can not work normally, the path will be null. What we need to do is just run install.js, which can check in file README.md |
Uninstall |
here was my command:
markdown-pdf report-paper-3.md -o $(uuidgen)
I got this error
the error makes no sense to me :( :(
The text was updated successfully, but these errors were encountered: