我尝试过进行node-gyp重建并安装所有依赖项,但仍然没有任何效果,这是我的错误
[email protected] install /media/jeremiah/Discord bot/Discord bot/node_modules/integer
> node-gyp rebuild
make: Entering directory '/media/jeremiah/Discord bot/Discord bot/node_modules/integer/build'
CXX(target) Release/obj.target/integer/src/integer.o
SOLINK_MODULE(target) Release/obj.target/integer.node
COPY Release/integer.node
COPY ../build/integer.node
TOUCH Release/obj.target/place_resulting_binary.stamp
make: Leaving directory '/media/jeremiah/Discord bot/Discord bot/node_modules/integer/build'
> [email protected] install /media/jeremiah/Discord bot/Discord bot/node_modules/better-sqlite3
> node-gyp rebuild
make: Entering directory '/media/jeremiah/Discord bot/Discord bot/node_modules/better-sqlite3/build'
TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
/bin/sh: 1: bot/Discord: not found
/media/jeremiah/Discord bot/Discord bot/node_modules/better-sqlite3/deps/extract.js:8
process.on('unhandledRejection', (err) => { throw err; });
^
CwdError: ENOENT: Cannot cd into '/media/jeremiah/Discord bot/Discord bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3'
at fs.lstat (/media/jeremiah/Discord bot/Discord bot/node_modules/tar/lib/mkdir.js:74:14)
at FSReqWrap.oncomplete (fs.js:152:21)
deps/locate_sqlite3.target.mk:16: recipe for target 'b857c92884e9598d609f6be182a2595df7a8e00f.intermediate' failed
make: *** [b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/media/jeremiah/Discord bot/Discord bot/node_modules/better-sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-45-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /media/jeremiah/Discord bot/Discord bot/node_modules/better-sqlite3
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sqlite@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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/jeremiah/\Buildagent\npm-cache/_logs/2019-02-09T20_04_52_918Z-debug.lo
我已经尝试做它所说的所有事情,但没有任何效果我想使用 better-sqlite3 来存储我的不和谐机器人信息,但如果我们无法弄清楚这一点,我只会使用 MySQL
安装新版本的nodeJs帮助我解决了这个问题
对于当前版本的 better-squlite3 (11.1.2),您必须自己安装当前版本的 @types/better-sqlite3 (7.6.11)。 这是在 Windows 11 计算机上的 BASH shell 中使用 pnpm 的情况,但对于其他环境可能也是如此。
也许这只是一个疏忽,将在未来的版本中纠正。