SrGobi
SrGobi
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by SrGobi on 6/7/2024 in #djs-questions
@DiscordJs/Opus installation error for node v20
I have been investigating the errors when installing this package and it seems that @Discordjs/opus is not compatible with version 20 of Node.JS By carrying out several installation/uninstallation tests, I have come to that conclusion, trying different versions of PYTHON and Node.JS and it is always the same for version 20 of Node.Js This error indicates that there was a problem trying to install the @discordjs/opus package. The specific error Error: spawn EINVAL usually occurs when there is a problem with your environment configuration. The error also mentions node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help. node-pre-gyp is a tool used to compile native Node.js modules, and it seems there was an issue with it.
7 replies
DIAdiscord.js - Imagine an app
Created by SrGobi on 7/19/2022 in #djs-questions
Fix Connect Timeout Error
everyone who has updated to discord.js V14 and on console get this: (It's an error about connection time, it seems that it takes time to connect, I don't know what but they should fix it soon)
ConnectTimeoutError: Connect Timeout Error
code: 'UND_ERR_CONNECT_TIMEOUT'
ConnectTimeoutError: Connect Timeout Error
code: 'UND_ERR_CONNECT_TIMEOUT'
You can solve it with the following
import { Client } from 'discord.js'
import { Agent } from 'undici'

const client = new Client({ ... })
const agent = new Agent({
connect: {
timeout: 30000
}
})

client.rest.setAgent(agent)

await client.login('...')
import { Client } from 'discord.js'
import { Agent } from 'undici'

const client = new Client({ ... })
const agent = new Agent({
connect: {
timeout: 30000
}
})

client.rest.setAgent(agent)

await client.login('...')
29 replies