window如何正确安装node-cavnas不报错

2023-04-23 11:54:53

按照下面的步骤安装canvas,一次就过了。

实在安装不成功的小伙伴,我给大家推荐另一款node平台上用的canvas,效果也不错,并且没有任何环境依赖。 @napi-rs/canvas

@napi-rs/canvas地址  https://github.com/Brooooooklyn/canvas

参考安装网址 Installation Canvas: Windows

⚠️ Be aware that according to known Chocolatey issues it is better to use instructions for manual install, provided above. If you figure out a way to fix the chocolatey instructions, feel free to edit this wiki.

All the dependencies can be installed with Chocolatey, the package manager for Windows.

  1. choco install -y python2 gtk-runtime microsoft-build-tools libjpeg-turbo (may require sudo/Administrator and reboot).

  2. You will need the cairo library which is bundled in GTK. Download the GTK 2 bundle for Win32 or Win64. Unzip the contents in C:\GTK.

  3. Run npm install canvas or yarn add canvas with command line from your project folder.


  • 2018-12-14 17:15:50

    Android适配刘海屏沉浸式状态栏的一些坑

    18年简直是刘海元年,所有手机都在跟风刘海屏,甚至每个厂商还有自己的一套适配规范。我的初始需求很简单,就是做一个全屏显示的页面,一般情况下只需要开启Android规范的全屏模式就好:

  • 2018-12-16 12:12:12

    android:windowSoftInputMode属性具体解释

    android:windowSoftInputMode属性一共同拥有9个取值。各自是: stateUnspecified,stateUnchanged。stateHidden,stateAlwaysHidden。stateVisible,stateAlwaysVisible,adjustUnspecified,adjustResize。adjustPan。

  • 2018-12-16 18:14:23

    Android在代码中设置状态栏半透明/全透明

    顶部是有文字,小图标等,如果直接用透明半透明 状态栏上的东西会与内容重叠(你觉得无所谓也可以直接用上面2部分代码),这样我们就想做成类似支付宝这样的效果:

  • 2018-12-18 15:33:01

    <![CDATA[]]>和转义字符

      此标记用于xml文档中,我们先来看看使用转义符的情况。我们知道,在xml中,”<”、”>”、”&”等字符是不能直接存入的,否则xml语法检查时会报错,如果想在xml中使用这些符号,必须将其转义为实体,如”&lt;”、”&gt;”、”&amp;”,这样才能保存进xml文档。