window如何正确安装node-cavnas不报错
@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.
-
choco install -y python2 gtk-runtime microsoft-build-tools libjpeg-turbo (may require sudo/Administrator and reboot).
-
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.
-
Run npm install canvas or yarn add canvas with command line from your project folder.