#Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'file-type'

21 messages · Page 1 of 1 (latest)

torpid geode
#

I get this error and dont know how to solve this.

Did you mean to import file-type/index.js?
    at new NodeError (node:internal/errors:372:5)
    at packageResolve (node:internal/modules/esm/resolve:954:9)
    at moduleResolve (node:internal/modules/esm/resolve:1003:20)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ESMLoader.import (node:internal/modules/esm/loader:380:22)
    at importModuleDynamically (node:internal/modules/cjs/loader:1043:29)
    at importModuleDynamicallyWrapper (node:internal/vm/module:437:21)
    at importModuleDynamically (node:vm:381:46) {
  code: 'ERR_MODULE_NOT_FOUND'
} Unhandled Rejection at Promise```
pearl radishBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

torpid geode
#

Node version: v16.16.0

charred sage
#

Can you run npm ls discord-api-types and show the full output please?

torpid geode
charred sage
#

And npm ls file-type?

torpid geode
charred sage
#

Weird.. try re-installing discord.js

torpid geode
#

alright,

charred sage
#

npm rm discord.js then install again

torpid geode
#

alright

#

I will let you know if it worked! ty already

torpid geode
#

So, the issue still persists.

charred sage
# torpid geode

Umm, why exactly did you run the npm commands in a different bot‘s folder than the one you got the error from?

torpid geode
#

because this error is from my client

#

but i compile the bot with nexe, so im not sure why this error occurs

charred sage
#

So does it happen when you run it with node directly too?

torpid geode
#

i have to try, 1 sec

charred sage
#

That information would‘ve been good to have from the start…

torpid geode
charred sage