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 while running Atlanta | Array Not a function #591

Closed
S1mp1yDucky opened this issue Nov 13, 2021 · 6 comments
Closed

Error while running Atlanta | Array Not a function #591

S1mp1yDucky opened this issue Nov 13, 2021 · 6 comments

Comments

@S1mp1yDucky
Copy link

S1mp1yDucky commented Nov 13, 2021

While running node . I got this error below:

  • Error in screenshot below:

Expected behavior
No errors were to be expected.

Screenshots
image

image

Further details:

  • atlanta version: 4.12.0
  • discord.js version: I used "npm install"
  • Node.js version: v16.13.0
  • NPM Version: 8.1.0
  • Operating system: Windows 10
@SickProdigy
Copy link

This is what you fixed by using node v 12?

Think I run 14 normally. About to spin a fresh vm with 12 on it and test a bot.

@SickProdigy
Copy link

`22:49:24 PM2 | App [sgtestbot:0] exited with code [1] via signal [SIGINT]
22:49:24 PM2 | App [sgtestbot:0] starting in -fork mode-
22:49:24 PM2 | App [sgtestbot:0] online
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: Error: Cannot find module 'node:events'
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: Require stack:
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/client/BaseClient.js
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/index.js
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/helpers/extenders.js
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/atlanta.js
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at require (internal/modules/cjs/helpers.js:74:18)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Object. (/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/client/BaseClient.js:3:22)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Module._compile (internal/modules/cjs/loader.js:956:30)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Module.load (internal/modules/cjs/loader.js:812:32)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Function.Module._load (internal/modules/cjs/loader.js:724:14)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Module.require (internal/modules/cjs/loader.js:849:19)
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39) {
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: code: 'MODULE_NOT_FOUND',
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: requireStack: [
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/client/BaseClient.js',
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/index.js',
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/helpers/extenders.js',
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/atlanta.js'
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: ]
22:49:24 0|sgtestbot | 2021-11-13T22:49:24: }
22:49:24 PM2 | App [sgtestbot:0] exited with code [1] via signal [SIGINT]
22:49:24 PM2 | Script /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/atlanta.js had too many unstable restarts (16). Stopped. "errored"
^Z
[2]+ Stopped pm2 start atlanta.js --name sgtestbot --no-daemon --time --log /home/sickprodigy/javascript-bot/atlanta4.12/logs/
(base) sickprodigy@sickvm:/javascript-bot/atlanta4.12/AtlantaBot-4.12.0$ pm2 ls
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name │ mode │ ↺ │ status │ cpu │ memory │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0 │ sgtestbot │ fork │ 45 │ errored │ 0% │ 0b │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
(base) sickprodigy@sickvm:
/javascript-bot/atlanta4.12/AtlantaBot-4.12.0$ npm install
npm WARN [email protected] requires a peer of discord.js@^12.0.0 but none is installed. You must install peer dependencies yourself.

up to date in 2.376s
(base) sickprodigy@sickvm:~/javascript-bot/atlanta4.12/AtlantaBot-4.12.0$
`

Node v12.13.0
npm v6.12.0
pm2 v 5.1.2
Atlanta: 4.12.0

Surprised it errored on npm install like that.
Think I'll try updating some packages.
Can you tell me what my setup differs from yours?

Was a pain to figure out how to update node but easy to just use npm.

@SickProdigy
Copy link

After updating npm to the same version as you and then installing that missing node package listed above. and now i get this error.

23:15:24 PM2 | App [sgtestbot:0] exited with code [1] via signal [SIGINT]
23:15:24 PM2 | App [sgtestbot:0] starting in -fork mode-
23:15:24 PM2 | App [sgtestbot:0] online
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: Error: Cannot find module 'node:events'
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: Require stack:
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/client/BaseClient.js
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/index.js
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/helpers/extenders.js
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: - /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/atlanta.js
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at require (internal/modules/cjs/helpers.js:74:18)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Object. (/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/client/BaseClient.js:3:22)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Module._compile (internal/modules/cjs/loader.js:956:30)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Module.load (internal/modules/cjs/loader.js:812:32)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Function.Module._load (internal/modules/cjs/loader.js:724:14)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Module.require (internal/modules/cjs/loader.js:849:19)
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39) {
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: code: 'MODULE_NOT_FOUND',
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: requireStack: [
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/client/BaseClient.js',
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/node_modules/discord.js/src/index.js',
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/helpers/extenders.js',
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: '/home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/atlanta.js'
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: ]
23:15:24 0|sgtestbot | 2021-11-13T23:15:24: }
23:15:24 PM2 | App [sgtestbot:0] exited with code [1] via signal [SIGINT]
23:15:24 PM2 | Script /home/sickprodigy/javascript-bot/atlanta4.12/AtlantaBot-4.12.0/atlanta.js had too many unstable restarts (16). Stopped. "errored"
^Z
[4]+ Stopped pm2 start atlanta.js --name sgtestbot --no-daemon --time --log /home/sickprodigy/javascript-bot/atlanta4.12/logs/

Going to try removing node_modules and retrying node install see how it goes.
Just weird to me some people can get it working out of the box and trying to figure out why. Can you show your package.json?

@S1mp1yDucky
Copy link
Author

If you have the npm chocolaty installed then you should download the latest node js from the website and then reinstall node modules using npm install --force

@uaktags
Copy link

uaktags commented Nov 19, 2021

Remove the .array() as v13 uses the maps.

setInterval(async () => {
			client.databaseCache.mutedUsers.filter((m) => m.mute.endDate <= Date.now()).forEach(async (memberData) => {

Remove the .array().length calls with .size() instead

const aCmdsLength = commands.filter((cmd) => cmd.help.category === a).size;

Add bot scope to the generateInvite:

client.generateInvite({
				scopes: ["bot"],

that should fix you up in #528 as well.
There's also some changes for the Dashboard too but I'm not ready with a PR to list them (user.status is going to be an issue, I instead passed req.client.presence to be able to grab status)

@S1mp1yDucky
Copy link
Author

Thank you ❤️, I'll close this now

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

3 participants