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

PDF Creation Error: spawn /root/pando-app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT #703

Open
achyut1901 opened this issue Apr 4, 2023 · 1 comment

Comments

@achyut1901
Copy link

I am trying to use node-html-pdf on linux/arm64 combination where I went into phantom-js prebuilt package and edited the download URL to download extract file for which supports linux-arm-64
refer this link: https://github.com/JerryFu-fyy/phantomjs-2.1.1-linux-arm
I am getting the below error
PDF Creation Error: spawn /root/pando-app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I ran node install.js inside node_modules of phantomjs module
getting below error
Error verifying phantomjs, continuing Error: spawn /root/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT at ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, code: 'ENOENT', syscall: 'spawn /root/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs', path: '/root/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs', spawnargs: [ '--version' ], cmd: '/root/app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs --version' }

can anyone help me in this

@kwen94
Copy link

kwen94 commented Apr 23, 2023

There is no problem to operate on Linux system. However, on windoows system, has error as following:

Error: spawn D:Servicephantomjs-2.1.1-windowinphantomjs ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn D:Servicephantomjs-2.1.1-windows\binphantomjs',
path: 'D:Servicephantomjs-2.1.1-windows\binphantomjs',
spawnargs: [
'--local-url-access=false',
'E:.......\html-pdf\lib\scripts\pdf_a4_portrait.js'
]
}

The Configure is
const options = {
height: '100000px',
width: width + 'px',
orientation: 'portrait',
type: 'png',
quality: '20',
timeout: 3000,
phantomPath: './node_modules/phantomjs/bin/phantomjs'
};

And after I annotated the "phantomPath", it could be ok to operate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants