当前位置:网站首页>安装canvas遇到的问题和运行项目遇到的报错
安装canvas遇到的问题和运行项目遇到的报错
2022-06-12 12:05:00 【程序务虚论】
1.mac安装问题
1)第一步使用brew安装:brew install pkg-config cairo pango libpng jpeg giflib librsvg
如果上面命令安装出错,可以分开安装(推荐)
brew install pkg-config
brew install cairo
brew install pango
brew install libpng
brew install jpeg
brew install giflib
brew install librsvg
具体也可以参考官网文档:
GitHub - Automattic/node-canvas: Node canvas is a Cairo backed Canvas implementation for NodeJS.Node canvas is a Cairo backed Canvas implementation for NodeJS. - GitHub - Automattic/node-canvas: Node canvas is a Cairo backed Canvas implementation for NodeJS.
https://github.com/Automattic/node-canvashttps://github.com/Automattic/node-canvas/wiki/
https://github.com/Automattic/node-canvas/wiki/ 安装完之后,可以使用命令:brew list 查看是否都已安装上
2)第二步安装canvas
npm instal canvas
安装完之后,使用命令:npm list 查看是否已安装上canvas
2.运行项目报错一:
Error: Cannot find module '/Users/ymxx/xx/xx/xx/node_modules/canvas'
解决方案:
将安装好的canvas(位置:usr/local/lib/node_modules/node-canvas)复制到项目下面-node_modules下面,并改名为canvas(名字与项目中一致)
3.运行项目报错二:
Error: Cannot find module '../build/Release/canvas.node'
解决方案:
在当前项目中打开终端
先执行:npm uninstall canvas
再安装:npm i canvas
安装完之后使用命令:npm list 查看是否在本项目中已安装成功
最后重新初始化:yarn install
启动项目成功!
边栏推荐
- Basic concepts of machine learning
- IP地址管理
- 如何确定首页和搜索之间的关系呢?首页与搜索的关系
- Load/store instruction addressing mode of arm instruction set (2)
- Blue Bridge Cup 2015 CA provincial competition (filling the pit)
- 机器学习之决策树
- 7-5 complex quaternion operation
- PIP install in the CONDA environment cannot be installed into the specified CONDA environment (the default PIP installation location of the CONDA environment)
- Pytoch notes
- TinyMCE series (III) introduction to common TinyMCE APIs
猜你喜欢

Lambda and filter, List 和 numpy array的索引,以及各种距离指标distance-metrics,拼接数组以及axis=0 and axis=1的区分

7-5 complex quaternion operation

Must do skill -- use ffmpeg command to quickly and accurately cut video

PDSCH related

Ficusjs series (I) introduction to ficusjs

Find the median of two ordered arrays (leetcode 4)

B. Wall painting (C language)

A.前缀极差

IP地址管理

mysql复习
随机推荐
ARM指令集之Load/Store指令寻址方式(一)
TinyMCE series (I) TinyMCE environment construction
Analyze the implementation principle of the onion model, and connect the onion model in your own project
视频分类的类间和类内关系——正则化
服务端渲染与客户端渲染的区别(优缺点)
导航中,添加边框影响布局的解决方法
标品和非标品如何选品,选品的重要性,店铺怎样布局
Pytorch笔记
Chapter VI data type (V)
B.刷墙(C语言)
Cookies and sessions
【QNX Hypervisor 2.2 用户手册】4 构建QNX Hypervisor系统
ELK搭建指南
Rich text editor copying pictures in word documents
Doris records service interface calls
Video JS library uses custom components
Ficusjs series (I) introduction to ficusjs
First understand the onion model, analyze the implementation process of middleware, and analyze the source code of KOA Middleware
LeetCode 497. 非重叠矩形中的随机点(前缀和+二分)
作物模型的区域模拟实现过程初探