为什么 node-sodium 包不起作用

问题描述

这里我使用 node 来制作一个不和谐的机器人,但我认为包有问题 此外,在 node_modules 目录(文件夹)中找不到钠 尝试了很多方法,但没有任何效果:(

Repl.it: Updating package configuration

--> npm install

> sodium@3.0.2 preinstall /home/runner/test/node_modules/sodium
> node install.js --preinstall

Static libsodium was not found at /home/runner/test/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source.
libtool is required,but wasn't found on this system
Makefile:61: recipe for target 'libsodium' Failed
make: *** [libsodium] Error 1
/home/runner/bgrb/node_modules/sodium/install.js:293
            throw new Error(cmdLine + ' exited with code ' + code);
            ^

Error: make libsodium exited with code 2
    at ChildProcess.<anonymous> (/home/runner/test/node_modules/sodium/install.js:293:19)
    at ChildProcess.emit (events.js:314:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm WARN discord.js@11.6.4 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sodium@3.0.2 preinstall: `node install.js --preinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sodium@3.0.2 preinstall 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/runner/.npm/_logs/2021-03-07T10_42_18_435Z-debug.log
exit status 1

解决方法

我假设您正在使用某种形式的 linux 发行版。 (如果我错了,请纠正我。)


从外观上看,您错过了libtool

尝试在终端中运行 apt-get install libtool。 (或使用您使用的任何包管理器安装!)


如果您没有使用 linux,或者您仍然遇到问题,请随时回复此帖子。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...