Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

5.3K
Views
Node.js node:internal/modules/cjs/loader:936 error while trying to use discord.js

I'm trying to make a discord bot with the command prefix "*" but when I try to get the bot online/run it, it gives me this error:

node:internal/modules/cjs/loader:936 node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'C:\Users\name\const' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

The module I'm using is discord.js and i've installed discord.js on CMD and the VSC terminal but it still comes up with the MODULE NOT FOUND error. I've looked around the internet and I can't find one that fixes the problem. I've tried reinstalling Node.js but it won't stop coming back. Please help, Thanks!

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

same error with me but I just change file dir cause I run node <filename.js> in the wrong dir so I just change like --- the first step chacks you are in the right dir or not type: > ls then if you are in the right dir then type: node <filename.js> if not then change your dir to change dir type: cd <filename> and then run your first app or file for run type: node <filename.js>

I hope your error is solved!

over 4 years ago · Santiago Trujillo Report

0

you need to run it as an administrator so sudo(whatever you tryna run) as long as you are in the right directory

over 4 years ago · Santiago Trujillo Report

0

I had the same error and it was a case of trying to run the file in node from the wrong location.

My solution was to use the terminal and CD into the exact folder the file I was trying to run were and then after that I could run node filename.js.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!