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.


  • 2020-12-27 20:36:10

    音频播放AudioTrack之入门篇

    AudioTrack是管理和播放单一音频资源的类。AudioTrack仅仅能播放已经解码的PCM流,用于PCM音频流的回放。