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-01-29 14:33:07

    child_process中spawn和exec方法的使用

    child_process是nw.exe的一个内置模块,通过它可以实现创建多线程,并可实现主线程和子线程之间的通信。child_process模块中主要使用有两个方法spawn和exec,这两个方法都可以用来创建子线程。除了spawn和exec外,child_process模块还有execFile,fork,spawnSync,execFileSync,execSync,它们都是基于spawn的不同封装。 --------------------- 作者:黄泽平 来源:CSDN 原文:https://blog.csdn.net/zeping891103/article/details/52230175 版权声明:本文为博主原创文章,转载请附上博文链接!

  • 2019-01-29 14:50:51

    Node.js 编写跨平台 spawn 语句

    Node.js 是跨平台的,也就是说它能运行在 Windows、OSX 和 Linux 平台上。很多 Node.js 开发者都是在 OSX 上做开发的,然后再将代码部署到 Linux 服务器上。由于 OSX 和 Linux 都是基于 Unix 的,因此两者共性很多。Windows 也是 Node.js 官方支持的平台,只要你通过正确的方式写代码,就能在各个平台上毫无压力的跑起来。

  • 2019-01-30 17:53:21

    视图与临时表

    视图与表的不同之处:视图是一个虚表,即视图所对应的数据不进行实际存储,数据库只存储视图的定义,对视图的数据进行操作时,系统根据视图的定义去操作与视图相关联的基本表。

  • 2019-02-01 08:43:59

    JS 随机排序算法

    使用JS编写一个方法 让数组中的元素每次刷新随机排列