nodemon: error
my code:
the error:
const { Client, IntentsBitField } = require ('discord.js');
const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.GuildContent,
],
});
Client.login(
'no hehe'
);
const { Client, IntentsBitField } = require ('discord.js');
const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.GuildContent,
],
});
Client.login(
'no hehe'
);
[nodemon] 3.1.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node src/index.js`
C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:174
throw new DiscordjsRangeError(ErrorCodes.BitFieldInvalid, bit);
^
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
at IntentsBitField.resolve (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:174:11)
at C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:168:35
at Array.map (<anonymous>)
at IntentsBitField.resolve (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:168:18)
at new BitField (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:33:38)
at new IntentsBitField (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\IntentsBitField.js:9:1)
at Client._validateOptions (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\client\Client.js:514:25)
at new Client (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\client\Client.js:80:10)
at Object.<anonymous> (C:\Users\SWEET HOME\Desktop\BTEP\src\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14) {
code: 'BitFieldInvalid'
}
Node.js v20.11.1
[nodemon] app crashed - waiting for file changes before starting...
[nodemon] 3.1.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node src/index.js`
C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:174
throw new DiscordjsRangeError(ErrorCodes.BitFieldInvalid, bit);
^
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
at IntentsBitField.resolve (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:174:11)
at C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:168:35
at Array.map (<anonymous>)
at IntentsBitField.resolve (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:168:18)
at new BitField (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\BitField.js:33:38)
at new IntentsBitField (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\util\IntentsBitField.js:9:1)
at Client._validateOptions (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\client\Client.js:514:25)
at new Client (C:\Users\SWEET HOME\Desktop\BTEP\node_modules\discord.js\src\client\Client.js:80:10)
at Object.<anonymous> (C:\Users\SWEET HOME\Desktop\BTEP\src\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14) {
code: 'BitFieldInvalid'
}
Node.js v20.11.1
[nodemon] app crashed - waiting for file changes before starting...
2 Replies
- 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!
- ✅
Marked as resolved by OPoh-
yeah!
that's right, bot's online now
THANK YOU! YAYAYAY!