Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'node:events' #14

Closed
Owned67 opened this issue Feb 11, 2022 · 26 comments
Closed

Error: Cannot find module 'node:events' #14

Owned67 opened this issue Feb 11, 2022 · 26 comments

Comments

@Owned67
Copy link

Owned67 commented Feb 11, 2022

`npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/collection@0.2.4',
npm WARN EBADENGINE required: { node: '>=16.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v14.16.0', npm: '8.5.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/rest@0.1.1-canary.0',
npm WARN EBADENGINE required: { node: '>=16.0.0' },
npm WARN EBADENGINE current: { node: 'v14.16.0', npm: '8.5.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'discord.js@13.6.0',
npm WARN EBADENGINE required: { node: '>=16.6.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v14.16.0', npm: '8.5.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/builders@0.11.0',
npm WARN EBADENGINE required: { node: '>=16.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v14.16.0', npm: '8.5.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/collection@0.4.0',
npm WARN EBADENGINE required: { node: '>=16.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v14.16.0', npm: '8.5.0' }
npm WARN EBADENGINE }

up to date, audited 210 packages in 2s

12 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
`

`F:\rust\rustPlusPlus>node index.js
internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module 'node:events'
Require stack:

  • F:\rust\rustPlusPlus\node_modules\discord.js\src\client\BaseClient.js
  • F:\rust\rustPlusPlus\node_modules\discord.js\src\index.js
  • F:\rust\rustPlusPlus\index.js
    ←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
    ←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
    ←[90m at Module.require (internal/modules/cjs/loader.js:952:19)←[39m
    ←[90m at require (internal/modules/cjs/helpers.js:88:18)←[39m
    at Object. (F:\rust\rustPlusPlus\node_modules\←[4mdiscord.js←[24m\src\client\BaseClient.js:3:22)
    ←[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
    ←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
    ←[90m at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
    ←[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
    ←[90m at Module.require (internal/modules/cjs/loader.js:952:19)←[39m {
    code: ←[32m'MODULE_NOT_FOUND'←[39m,
    requireStack: [
    ←[32m'F:\rust\rustPlusPlus\node_modules\discord.js\src\client\BaseClient.js'←[39m,
    ←[32m'F:\rust\rustPlusPlus\node_modules\discord.js\src\index.js'←[39m,
    ←[32m'F:\rust\rustPlusPlus\index.js'←[39m
    ]
    }`

edit: updating nodejs in progress..

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

so okay, sometinh wrong:

node index.js
2022-2-11 18:05:09 INFO: LOGGED IN AS: RustPlus#3143
2022-2-11 18:05:09 INFO: Waiting 5 seconds to make sure all text channels are created
2022-2-11 18:05:10 ERROR: {"rawError":{"message":"Missing Access","code":50001},"code":50001,"status":403,"method":"put","url":"https://discord.com/api/v9/applications/XXXXXXXXXXXXXXXXXX/guilds/268XXXXXXXXXXXXXXX/commands"}

RustPlusPlus channel is created with a lot settings... so idk what is wrong with this message above

@alexemanuelol
Copy link
Owner

By the looks of it you didn't create the bot invitation with the correct options. Check the README in the section 'Create a discord bot'.

Click on OAuth2 tab on the website.
Scroll down to OAuth2 URL Generator.
Check the following boxes: bot and applications.commands
Scroll down to Bot permissions and select the following: Administrator
Copy the URL (This is used to invite you discord bot to discord servers (guilds))

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

Bot have administrator privileges, i can't make better and ive follow the readme

@alexemanuelol
Copy link
Owner

Have you selected bot and applications.commands?

@alexemanuelol
Copy link
Owner

Because I think it's the applications.commands that might be missing

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

Have you selected bot and applications.commands?

ye
rustplus
s

@alexemanuelol
Copy link
Owner

Is it possible that its the same bot you used for the other bot? Try to Create a completely new discord bot.

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

no it's a new bot

@alexemanuelol
Copy link
Owner

What nodejs version are you running?

@alexemanuelol
Copy link
Owner

@alexemanuelol
Copy link
Owner

Oh nevermind, that was for another problem. Your problem is solution 1...

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

What nodejs version are you running?

v16.14.0

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

i can't make better sorry, ive follow your readme...

@alexemanuelol
Copy link
Owner

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

https://stackoverflow.com/questions/68886388/trying-to-register-commands-discordapierror50001-missing-access

Same problem, same solution...

Ive re created and same.. have you see my gif??? i can't make better guy...

@alexemanuelol
Copy link
Owner

I saw the GIF, did you re-invite the bot to your discord server?

@alexemanuelol
Copy link
Owner

Or did you just click the copy button?

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

Ive re created and same.

Ive re created and same.

@alexemanuelol
Copy link
Owner

Did you remove it from your server and re-invite:ed?

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

It's again a new bot and other was kicked and all channel removed before invit him

@alexemanuelol
Copy link
Owner

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

I know how to invite a bot thanks ^^ Im off for tonight, tomorrow im up ;)

@alexemanuelol
Copy link
Owner

Okioki, then Im afraid I can't really help you 😕

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

that weird really, im checking in files, open 268426701401227264.json and found:

"channelId": {
   "category": "941782038401409034",
   "information": "941782039412215828",
   "servers": "941782040146219039",
   "settings": "941782040846671874",
   "events": "941782042318876763"
 },
``` all is created so why it give this error? :x

@alexemanuelol
Copy link
Owner

It's when it's trying to register the Slash Commands for your guild. And usually it is solved by adding the 'applications.commands' to the invitation URL.

@Owned67
Copy link
Author

Owned67 commented Feb 11, 2022

Solved

@Owned67 Owned67 closed this as completed Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants