簡體   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