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.


  • 2019-09-11 15:28:07

    Node 性能优化

    硬盘的 IO 开销是非常昂贵的,硬盘 IO 花费的 CPU 时钟周期是内存的 41000000/250 = 164000 倍。 所有在一般应用中,优化要首先考虑数磁盘 IO , 通常也就是数据层的优化,说到数据库优化,很多人第一时间会想到加索引,但是什么加了索引查询会变快呢?索引要怎么加才合适呢?

  • 2019-09-11 16:49:56

    flex布局详解,Flex 布局语法教程

    布局的传统解决方案,基于盒状模型,依赖 display属性 + position属性 + float属性。它对于那些特殊布局非常不方便,比如,垂直居中就不容易实现

  • 2019-09-12 16:32:19

    JSLint,JSHint,ESLint的区别

    主流的JS Lint工具及介绍 JavaScript已经发展蛮长时间了,对应的Lint工具也是层出不穷,下面介绍一下比较主流的几个Lint工具(其实是我用过的几个XD)

  • 2019-09-16 22:56:52

    java.lang.NoSuchMethodError:SpringJAR包版本冲突错误解决方法

    查询了相关资料,大部分都说引起的原因是JAR包错误或JAR包冲突,查看了配置文件,并没有发现错误之处,因为用的是maven工程,这让我想到了maven的JAR引用的传递性,应该是引用的JAR包中传递引用了相同的包,没有排除。通过mvn dependency:tree 命令查看当前工程引用的依赖JAR树