无法安装jspdf 1.5.3 [英] Cannot install jspdf 1.5.3

查看:2728
本文介绍了无法安装jspdf 1.5.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将html转换为pdf,而我正在使用jspdf 1.5.2. 它显示错误无法读取未定义的属性'charAt'(与html2canvas一起使用).

I need to convert html to pdf and I am using jspdf 1.5.2. It shows the error Cannot read property 'charAt' of undefined (using with html2canvas).

当我尝试安装jspdf 1.5.3时,我得到了:

When I try to install jspdf 1.5.3 I get this:

npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR! enoent 
npm ERR! enoent 
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

我已经阅读了其他线程,但它们都没有帮助.

I have read the other threads and none of them are helpful.

推荐答案

对于jsPDF版本1.5.3,他们使用直接来自GitHUB的依赖项.我假设您正在CI中运行构建?您可以安装git + ssh或在此时返回jsPDF 1.5.2版.他们的错误跟踪器中存在很多问题.这似乎是相关的问题 https://github.com/MrRio/jsPDF/issues/2208 .它被标记为固定,但是到目前为止没有新版本1.5.4.

With Version 1.5.3 of jsPDF they use a dependency directly from GitHUB. I'm assuming you're running the build in a CI? Either you install git + ssh or at that point return to version 1.5.2 of jsPDF. There's a bunch of issues in their bug tracker. This seems to be the relevant issue https://github.com/MrRio/jsPDF/issues/2208. It's marked fixed, but so far no new version 1.5.4.

这篇关于无法安装jspdf 1.5.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆