kempsteven / vue-html2pdf

vue-html2pdf converts any vue component or element into PDF, vue-html2pdf is basically a vue wrapper only and uses html2pdf.js behind the scenes.
https://www.npmjs.com/package/vue-html2pdf
MIT License
440 stars 75 forks source link

Cannot install via npm #38

Open rickshawhobo opened 4 years ago

rickshawhobo commented 4 years ago

Getting this error when doing npm i vue-html2pdf

npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
kempsteven commented 4 years ago

Hmm could you try and delete your /node_modules folder and do an npm install and then do the npm i vue-html2pdf?

kempsteven commented 4 years ago

Same issue as this https://github.com/kempsteven/vue-html2pdf/issues/26

rickshawhobo commented 4 years ago

I think the ssh format is ssh://git@github.com:eligrey/FileSaver.js.git

rickshawhobo commented 4 years ago

I tried the solution btw and it does not work for me. Same error.

kempsteven commented 4 years ago

Are you still experiencing this problem? I tried replicating it in a fresh project using vue cli and I ran the command npm i vue-html2pdf and it works.

I researched and it seems there is a problem in the package jsPDF which is a package that used by html2pdf.js

rickshawhobo commented 4 years ago

I have found no way to make this work, unless I can install jsPDF 1.4.1 BEFORE installing html2pdf but in the package.json file it always tries to install html2pdf before jsPDF. I really don't know how it works for you.

kempsteven commented 4 years ago

Crap that's weird, I can't replicate it and it only happens with some selected people.

I believe this happened when I upgraded from html2pdf.js 0.9.0 to 0.9.2, which used a more latest version of jsPDF that could have caused the error, I'm thinking of downgrading the package.

I also saw a few people resolving it by installing jspdf first npm i jspdf then installing html2pdf.js, or in this case npm i vue-html2pdf

I also saw this, as per the creator of html2pdf.js, you could also try this solution

pashtet86 commented 4 years ago

Hi, the same issue for me. It's related to loading dependency issue in jsPDF https://github.com/MrRio/jsPDF/issues/2208

Zhbel commented 4 years ago

I found solution: 1) Install jspdf 1.5.2: npm i jspdf@1.5.2 2) install this plugin: npm i vue-html2pdf Works for me