Jump to content

Error: Cannot find module 'discord.js'

Closed 2.1.2

Dr.D.Bug
Dr.D.Bug

Posted

Got this Errormessage @ FPS.ms:
 

npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/container/node_modules/discord.js
npm error dest /home/container/node_modules/.discord.js-PAVAWahc
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/container/node_modules/discord.js' -> '/home/container/node_modules/.discord.js-PAVAWahc'
npm error A complete log of this run can be found in: /home/container/.npm/_logs/2024-08-30T18_13_09_098Z-debug-0.log
Error: Cannot find module 'discord.js'
Require stack:
- /home/container/src/linkingHandler.js
- /home/container/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/usr/local/lib/node_modules/ts-node/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/container/src/linkingHandler.js:2:17)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Object.require.extensions.<computed> [as .js] (/usr/local/lib/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1288:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/container/src/linkingHandler.js',
    '/home/container/index.js'

Amino

Posted

It looks like you’re running the bot from a hosted service.

In that case, make sure you have the package.json file that I provided in the bot files. If you already do restart the bot and it should auto install all the packages depending on your host. 

Dr.D.Bug

Posted

I have the package.json, but still got error messages after restart...

Screenshot 2024-08-30 220703.png

Screenshot 2024-08-30 221025.png

Amino

Posted

Looks like your host does not auto import the packages. You'll need to manually import them all

  • Like 1
Dr.D.Bug

Posted

Okay, i hope to figure it out tomorrow @ fps.ms somehow. Maybe i come back with some more questions but if i'll find a solution there i will let you know.

Dr.D.Bug

Posted

After i changed the Discord.js Version in the package.json to  "discord.js": "^14.15.3",  and deleted the folder .npm and node_modules it finally works. Don't know if it would have been enough to just delete the two directories but now it works. There are still a few warning messages about old versions. Do you know which are the current versions are?
image.png.4b9187e44be315bc6fa7110c4ab93b33.png

Amino

Posted

You don’t need to worry about any of those messages. Some of those are sub packages that other dependencies use 

Dr.D.Bug

Posted

Now i got new Error Messages and the process works until the point where the role should be changed. The new user stands with his first role and got no new role

image.png.097af1baee65015c51e6b16b016afe17.png

Dr.D.Bug

Posted (edited)

Do you have a guide how to install and run this bot on a own linux server via docker?
I have a small virrtual Ubuntu Linux Server @ IONOS formerly known as 1&1 in Germany just for testing purposes, but in this case it could help me.
If this not work, i also have a smal RhaspberryPi 5 next to my my router waiting for many exciting tasks 😜

Edited by Dr.D.Bug
Amino

Posted

On 8/31/2024 at 9:51 AM, Dr.D.Bug said:

Now i got new Error Messages and the process works until the point where the role should be changed. The new user stands with his first role and got no new role

image.png.097af1baee65015c51e6b16b016afe17.png

Bot does not have permission to add or remove roles. Make sure it's also higher than the roles it's trying to grant to people

Amino

Posted

Changed Status from Pending to Closed

Dr.D.Bug

Posted

On 9/12/2024 at 6:28 PM, Amino said:

Bot does not have permission to add or remove roles. Make sure it's also higher than the roles it's trying to grant to people

Thanks, i'll try this soon and let you know

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.