Error

root@VPS-10384:~/7bLogsBot# node index node:internal/modules/cjs/loader:1137 throw err; ^ Error: Cannot find module '/root/7bLogsBot/node_modules/@discordjs/opus/prebuild/node-v108-napi-v3-linux-x64-glibc-2.35/opus.node' Require stack: - /root/7bLogsBot/node_modules/@discordjs/opus/lib/index.js - /root/7bLogsBot/index.js at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15) at Module._load (node:internal/modules/cjs/loader:975:27) at Module.require (node:internal/modules/cjs/loader:1225:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/root/7bLogsBot/node_modules/@discordjs/opus/lib/index.js:5:18) at Module._compile (node:internal/modules/cjs/loader:1356:14) at Module._extensions..js (node:internal/modules/cjs/loader:1414:10) at Module.load (node:internal/modules/cjs/loader:1197:32) at Module._load (node:internal/modules/cjs/loader:1013:12) at Module.require (node:internal/modules/cjs/loader:1225:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/root/7bLogsBot/node_modules/@discordjs/opus/lib/index.js', '/root/7bLogsBot/index.js' ] } Node.js v18.19.1
19 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Deleted User 63cfadbe
{
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.16.0",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@kirdock/discordjs-voice-recorder": "^1.0.4",
"discord-logs": "^2.0.0",
"discord.js": "^13.15.1",
"ffmpeg": "^0.0.4",
"ffmpeg-static": "^5.1.0",
"fluent-ffmpeg": "^2.1.2",
"index.js": "^0.0.3",
"libsodium-wrappers": "^0.7.11",
"node": "^19.8.1",
"node-gyp": "^9.4.0",
"node-pre-gyp": "^0.17.0",
"opusscript": "^0.0.8",
"prism-media": "^2.0.0-alpha.0",
"sodium-native": "^4.0.4",
"tweetnacl": "^1.0.3",
"util": "^0.12.5",
"valuesaver": "^1.9.3"
}
}
{
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.16.0",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@kirdock/discordjs-voice-recorder": "^1.0.4",
"discord-logs": "^2.0.0",
"discord.js": "^13.15.1",
"ffmpeg": "^0.0.4",
"ffmpeg-static": "^5.1.0",
"fluent-ffmpeg": "^2.1.2",
"index.js": "^0.0.3",
"libsodium-wrappers": "^0.7.11",
"node": "^19.8.1",
"node-gyp": "^9.4.0",
"node-pre-gyp": "^0.17.0",
"opusscript": "^0.0.8",
"prism-media": "^2.0.0-alpha.0",
"sodium-native": "^4.0.4",
"tweetnacl": "^1.0.3",
"util": "^0.12.5",
"valuesaver": "^1.9.3"
}
}
ThePedroo
ThePedroo3mo ago
Usually this happens when the Node.js version is updated without re-building
Deleted User 63cfadbe
I did the command npm i also note my system is ubuntu 20.4
ThePedroo
ThePedroo3mo ago
npm rebuild
Deleted User 63cfadbe
I did an npm rebuild and the node_modules file was not uploaded! I did npm i @ThePedroo
ThePedroo
ThePedroo3mo ago
npm rebuild is used if node_modules exist
Deleted User 63cfadbe
I'm still facing the error
ThePedroo
ThePedroo3mo ago
npm rm @discord/opus && npm i opusscript This should work as a workaround
Deleted User 63cfadbe
Did not work @ThePedroo
ThePedroo
ThePedroo3mo ago
rm package-lock.json and execute it again
Deleted User 63cfadbe
I did it and it didn't work
ThePedroo
ThePedroo3mo ago
Then you must be in the wrong directory If it`s not on package.json, and it tries to install djs/opus, something is wrong
Deleted User 63cfadbe
This error I have encountered on more than one server Could the problem be from the server?
ThePedroo
ThePedroo3mo ago
No, mostly how you`re installing the packages
Deleted User 63cfadbe
And how to solve it
ThePedroo
ThePedroo3mo ago
^
ThePedroo
ThePedroo3mo ago
This is how it's fixed