electron 环境下 canvas 安装错误
现象
安装依赖 canvas 后,使用 electron-builder 的命令 install-app-deps
会出现
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@12.18.2 | win32 | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-electron-v10.1-win32-unknown-x64.tar.gz
node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-electron-v10.1-win32-unknown-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-electron-v10.1-win32-unknown-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and electron@10.1.0 (electron-v10.1 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-electron-v10.1-win32-unknown-x64.tar.gz
复现步骤
- 初始化项目
- 安装依赖
yarn add canvas
- 运行
yarn install-app-deps
可复现 GitHub 仓库
相关问题
- 链接 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-electron-v10.1-win32-unknown-x64.tar.gz 确实是 404,不是网络问题
- node-canvas-prebuilt 的发布目录确实没有
canvas-v2.6.1-electron-v10.1-win32-unknown-x64.tar.gz
- 有人提出了问题,但没有真正被解决。。。官方提出的一个解决方案是从 node-canvas 进行构建,参考:https://github.com/node-gfx/node-canvas-prebuilt/issues/9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论