【问题标题】:Box shadows with html2canvas - installing build from git带有 html2canvas 的框阴影 - 从 git 安装构建
【发布时间】:2020-04-25 09:25:43
【问题描述】:

html2canvas 主要版本的文档说它目前不支持盒子阴影,但现有版本支持。本页展示了 html2canvas 使用框阴影 working box shadows

我想将此版本添加到我的项目中并尝试过

npm install --save https://github.com/niklasvh/html2canvas.git

将这一行添加到我的 package.json 文件中

"html2canvas": "git://https://github.com/niklasvh/html2canvas.git",

但是当我尝试用

导入html2canvas
import html2canvas from 'html2canvas';

它给出了错误

Module not found: Can't resolve 'html2canvas'

我以前从未直接从 git 使用过库或 npm 包 - 我做错了什么?

【问题讨论】:

    标签: reactjs git npm-install html2canvas


    【解决方案1】:

    在 package.json 中尝试 username/repository#branch

    或尝试 npm install --save username/repo#branch-name。 在您的情况下 npm install niklasvh/html2canvas#master。 如果它不能解决您的问题,请告诉我。

    【讨论】:

    • 恐怕还是不能正确导入
    • 请尝试删除您的 node_modules 文件夹并重新安装。然后构建可能会成功。
    • 好的,删除 node_modules 并重新安装 - 仍然没有运气!
    • npm docs 有几种方法。看看是否有人适合你。
    猜你喜欢
    • 2021-11-27
    • 2014-02-09
    • 1970-01-01
    • 2013-07-28
    • 2019-04-19
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 2011-11-29
    相关资源
    最近更新 更多