- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,我想为 discord.js Bot 安装 Canvas 。
当我尝试使用以下命令安装 Canvas 时npm install canvas
我收到以下错误:
pi@server:~/Bots/Discord/Java $ npm install canvas
> canvas@2.6.1 install /home/pi/Bots/Discord/Java/node_modules/canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
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-node-v72-linux-glibc-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@12.18.4 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pixman-1' found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.51-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/Bots/Discord/Java/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/pi/Bots/Discord/Java/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/pi/Bots/Discord/Java/node_modules/canvas
gyp ERR! node -v v12.18.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/Bots/Discord/Java/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/Bots/Discord/Java/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/pi/Bots/Discord/Java/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 5.4.51-v7+
node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/Bots/Discord/Java/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/Bots/Discord/Java/node_modules/canvas
node-pre-gyp ERR! node -v v12.18.4
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/Bots/Discord/Java/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/Bots/Discord/Java/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN java@1.0.0 No description
npm WARN java@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2020-10-03T09_17_54_892Z-debug.log
有人知道我为什么会收到这个错误吗?
最佳答案
根据node-canvas wiki , 您需要从 apt 安装一些依赖项。
只需运行:
关于canvas - 在树莓派上安装 Canvas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64182660/
(“ donut 派”)是否有最大切片数?我使用了 highchart(“ donut 派”)示例,但无法超过 10 个切片。请注意,内部切片“F”丢失了。下面是示例代码。 http://jsfidd
有谁知道如何找到 Samsung Galaxy 手机等同于 Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS 的常量?我有一个应用程序在三星用户单击应该将他们带到“
所以我很难弄清楚如何设置饼图/图例位置的布局。我希望图例左对齐,饼图右对齐。 40/60 百分比 -ish。 像这样: chart = new Highcharts.Chart({ c
我试图创建一种带有 4 个切片的圆形旋转木马,通过单击一个切片,它会扩展到约 2/3 的饼图,显示它的内容(另一个切片同样会收缩)基本上我是从 raphael “growing pie” 演示开始的
我尝试了所有可能的方式来提供 PIE.js 的路径,我使用的是 asp.net,这与在 java+tomcat 中的工作方式相同。我试过这样给 1)文件:css/home.css,css/pie/PI
cmds = ['time'] while True: inp = input('::> ') sinp = inp.split() if str(sinp[0]) in cm
我已经在 Raphael Google Groups 上看到过这个问题,但经过数小时的搜索后,在这里以及 Google 上,我似乎找不到解决方案。 我只是希望能够使用 jQuery 定位我的饼图(sv
这个问题在这里已经有了答案: Permission Denial: startForeground requires android.permission.FOREGROUND_SERVICE (5
我是一名优秀的程序员,十分优秀!