繁体   English   中英

树莓派零 W 上的 Node.js,依赖项不会自动下载

[英]Node.js on a Raspberry Pi Zero W with dependencies not downloading automatically

我制作了一个 Discord bot,我想将它托管在 Pi 上,但是一旦我让 node.js 工作,我遇到了安装 npm 的墙,但依赖项不会随它一起下载。 有人能帮我吗?

代码

pi@raspberrypi:~/bot $ npm i discord.js
npm WARN deprecated snekfetch@3.6.4: use node-fetch instead
npm WARN discord.js@11.1.0 requires a peer of bufferutil@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.1.0 requires a peer of erlpack@hammerandchisel/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.1.0 requires a peer of node-opus@^0.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.1.0 requires a peer of opusscript@^0.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.1.0 requires a peer of sodium@^2.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.1.0 requires a peer of libsodium-wrappers@^0.5.1 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.1.0 requires a peer of uws@^0.14.1 but none is installed. You must install peer dependencies yourself.
npm WARN greeter-bot@1.0.0 No repository field.
npm WARN greeter-bot@1.0.0 No license field.

+ discord.js@11.1.0
updated 1 package in 24.205s

首先,我不建议在 Raspberry Pi 上托管 Discord 机器人,但为了与您的问题保持一致,我假设您坚持这样做。

您可以尝试两件事:

如果您安装了apt ,请运行命令apt install -a ,这将安装之前输出中缺少的所有软件包。

第二种方法是手动安装它说丢失的软件包。

转到npm 存储库,搜索缺少的包,然后下载它在输出中请求的版本。

希望这可以帮助!

好吧,我通过首先将我的电脑上的 npms 安装到特定文件夹来修复它,然后使用 Filezilla 传输它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM