Open hariaravind10 opened 3 years ago
I have recently initialized and installed html-pdf
, it appears that the new path to the PhantomJS Binary is in node_modules/phantomjs-prebuilt/bin/phantomjs
instead of node_modules/phantomjs/bin/phantomjs
.
How to solve the issue.. Please send the steps to solve this.
I am getting html-pdf in local but i didn't get it on AWS ec2 RHEL server.
Please help me
You need to install the phantam js prebuilt manuallyto the node_modules directory in the project. Remove the existing phantomjs-prebuilt
and the install the library manually.
I did it by adding the following lines in my dockerfile
RUN cd node_modules/ \ && rm -r phantomjs-prebuilt \ && wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1a/dockerized-phantomjs.tar.gz" | tar xz -C / \ && npm config set user 0 \ && npm install phantomjs-prebuilt
Add this line as the last step in docker file before the CMD line
You need to install the phantam js prebuilt manuallyto the node_modules directory in the project. Remove the existing
phantomjs-prebuilt
and the install the library manually.I did it by adding the following lines in my dockerfile
RUN cd node_modules/ && rm -r phantomjs-prebuilt && wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1a/dockerized-phantomjs.tar.gz" | tar xz -C / && npm config set user 0 && npm install phantomjs-prebuilt
Add this line as the last step in docker file before the CMD line
I am not able to install the phantomjs-prebuilt plese help me I am not using the docker, I am using ec2 instance and directly run the node using pm2.
AssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath' at new PDF (path of my folder/node_modules/html-pdf/lib/pdf.js:40:3) at Object.createPdf [as create] (/path of my folder/node_modules/html-pdf/lib/index.js:10:14)