小编Sam*_*eth的帖子

我怎样才能在 npm install 中克服这个错误?

你好!

我是一名初级程序员,我正在使用 node 和 discord.js 制作一个不和谐的机器人。我需要一个名为 的库canvas,但它没有安装!

我在我的 Windows 电脑上编程并测试了这个应用程序,然后将它发送到我的树莓服务器。它没有用,所以我再次尝试删除并安装该库,但是在安装时,它给出了这个错误:

(我想用这个命令来安装它:npm install canvas

npm ERR! path /home/pi/node/test/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! 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/node/test/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/node/test/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@15.0.1 | linux | arm
npm ERR! node-pre-gyp …
Run Code Online (Sandbox Code Playgroud)

javascript linux node.js npm raspberry-pi

1
推荐指数
3
解决办法
3071
查看次数

标签 统计

javascript ×1

linux ×1

node.js ×1

npm ×1

raspberry-pi ×1