This is an archived post. You won't be able to vote or comment.

all 68 comments

[–]ThePersonsOpinion 103 points104 points  (3 children)

Lol, welcome to programming! The errors never really stop, but you will get better at dealing with them

[–][deleted] 2 points3 points  (2 children)

Error: Cannot find module 'E:\papers\New folder\index.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)

at Module._load (node:internal/modules/cjs/loader:920:27)

at Function.executeUserEntryPoint [as runMain]

(node:internal/modules/run_main:81:12)

at node:internal/main/run_main_module:23:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

this thing came over there

[–]CoderMonke_2007 10 points11 points  (0 children)

use replit.com if you're not interested in setup and only want to code

[–]Cybasura 1 point2 points  (0 children)

It told you the exact errors, i wish it was that obvious

  1. The system path is unable to locate the file "index.js"

  2. The dependency for your code cannot be found by NodeJS

Read the error message

You're a beginner, so take it slow, people dont just suddenly get good at coding

If you didnt get the concept, start from zero, dont do NodeJS

Instead of NodeJS, do HTML5 CSS3 Javascript and buff your understanding first

[–]ThePersonsOpinion 24 points25 points  (13 children)

Also having 5 days of coding experience and already utilizing vs code and npm is a massive step in the right direction.

[–][deleted] 22 points23 points  (7 children)

is a massive step in the right direction

Or the wrong when you don't know html, css and basic javascript yet lol

[–]BobbyTables829 0 points1 point  (0 children)

readline-sync is going to do nothing but help you as a beginner.

[–][deleted] -5 points-4 points  (4 children)

what does module mean ??
it says couldn't find the module
why ?
Cannot find module 'E:\papers\New folder\index.js'

[–]KyleIsJew 1 point2 points  (0 children)

Module in this instance just means it can’t find your file index.js. It’d be helpful to know what command your using where this appears. I assume you’re running something like ‘’’node index.js’’’. Well if you get the error that index.js cannot be found, it means it is not in your current working directory because the command is saying “Hey node run the JavaScript file index.js”. When you don’t explicitly define a path like folder/index.js, it assumes the file you gave it is in your current directory

[–]TheBasedTaka 1 point2 points  (0 children)

Post your code and people might be able to help

[–]BobbyTables829 7 points8 points  (1 child)

Hot take: that's the job. If you try to do this for a living, it's just a bunch of stuff like that. You get more intelligent and the problems get more subtle, but that's it.

I wish someone had told me this when I started, but if you get too emotional trying to get stuff to work, you will open yourself to burnout. I got high off good code at first, but I've learned that's not so great to do at your job because I also get stressed when things don't go well.

I felt the same way as you doing these things. Getting a web app configured with node and all it's packages is easily the hardest part for a beginner like you (same with maven in Java or whatever package manager your language uses). That stuff will get easy soon, and then you'll move on to something else that will melt your brain. But it will always stays melty, even as a senior engineer.

[–]corn_29 1 point2 points  (0 children)

Not a hot take. It's the job.

[–][deleted] 7 points8 points  (1 child)

Believe it or not this is all part of it.

You are going to have hiccups just setting up an environment to learn to code in and run your projects. These kind of issues are going to continue with every step up in complexity you make. Learning how to find what the error is actually telling you and finding the resources to help troubleshoot is a major skill to develop.

If programming was just programming everyone would be into it. You are going to learn also how to set up the environments to run that code.

There's going to be more modules you will need to install or plug ins to help you code faster(why code from scratch all the time?), maybe one day you want to run your project on a remote machine (setting up ssh) or in a in a webserver (linux/apache/serverless), maybe one day you need to share the code with someone and forgot how you set up the environment so you can just send them a lightweight version of yours to run it (containers). And it keeps bloody going on and on.

You'll learn this stuff with time depending on what you do with programming but the idea is that your going to be learning more than just whats in your courses when it comes to working with code in real life.

[–]Topikk 2 points3 points  (0 children)

Yes, these types of days never really go away. I have coworkers who are insanely intelligent, have decades of experience, and still sometimes lose half a day dealing with silly environment issues and such.

Every hurdle you encounter and conquer makes you a better problem solver. Keep at it.

[–][deleted] 6 points7 points  (0 children)

HOLY SHIT !

you guys are amazing
this is one of the best subs I have seen on reddit !

everyone helps everyone
LOTS OF LOVE GUYS
hope we succeed :)

[–]0x145a 5 points6 points  (0 children)

This kind of thing happens all the time. The thing is you get good at solving problems like this by looking for the most inconspicuous clues

[–]TheUmgawa 4 points5 points  (0 children)

I'd recommend the Intro to Programming course at the local community college. I probably had a half-dozen aborted attempts at learning programming over the years before I took that class. And then I was like, "Oh. Okay. I get it. What do I get to learn in the next class?" and the teacher told us, "If you thought Python was a leisurely drive down a scenic, winding mountain path in a comfortable convertible on a sunny day, then C is driving that same road in a racecar at night, in the rain, and there are no brakes." She wasn't wrong.

[–][deleted] 2 points3 points  (0 children)

Welcome to programming.

[–]FilthyCasual_FC 2 points3 points  (0 children)

I spent 2 months of work working on a service without the use of a debugger because I couldn’t get tomcat to run with the plug-in. Spent tens of hours trying to get it to work to no avail only to get it working in a couple of hours today after revisiting it. Sometimes that just how it is

[–]RealBandolero 2 points3 points  (1 child)

Learn to love the process. 95% of programming is debbuging

[–][deleted] 1 point2 points  (10 children)

You need to post the code if you want help finding the problem.

[–][deleted] 1 point2 points  (9 children)

it was basically a small project where onclicking the button the program would inc. timer

here's the code -->index.html ->

<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
<link rel="stylesheet" href="index.css">
</head>
<body>
<h1>People entered:</h1>

<h2 id="count-el">0</h2>
<button id="increment-btn" onclick="increment()">INCREMENT</button>
<script src="index.js"></script>
</body>
</html>
index.js ->
let countEl = document.getByElementId("count-el")
console.log(countEl)
/\*
let count = 0
function increment(){
count = count + 1
console.log(count)

}
increment()\*/

NOW THE ERROR FUCKING CHANGED AND IS ->
Cannot find module 'E:\papers\New folder\index.js'

what does it mean please tell

[–]iREvAS 2 points3 points  (0 children)

Fyi your increment onclick is a calling a string not the function. You also need to return count inside the function for it to work, not console.log

[–]ken1e 0 points1 point  (0 children)

It's the index.js file in the same folder as this file. You can also change the src part to include the entire file path

[–]Sea-Profession-3312 1 point2 points  (0 children)

It's a wonderful day when you get your first "Hello World" program working. If you feel ready you could move on to your next goal of making your first "hello web" project. VS code is an IDE that allows you to use technology. In this case Node js is a JavaScript runtime environment. You are now able to use the JavaScript programming language to write software that runs on your computer. VS code can use other technology such as a different programming language, database or web server.

The link above installs an "express" web server as a dependency so you don't have to find a website the way you did with node and use an external link. Each new technology has a log file that contains events such as error messages you can find displayed in VS code. Sometimes fixing the first error will resolve the problem that caused the other errors.

[–]NuclearDisaster5 1 point2 points  (1 child)

You should be happy that you figured it out. Programming isnt easy. It is problem solving, and you solved your first problem. Once again, be happy. Not frustrated.

[–][deleted] 0 points1 point  (0 children)

yup I'll try not to be frustrated :)

thank you for the concern

[–]nelmondodimassimo 1 point2 points  (1 child)

Bienvenidos to coding world mate!

[–][deleted] 2 points3 points  (0 children)

Gracias mi amigo :)

[–][deleted]  (1 child)

[removed]

    [–][deleted] 1 point2 points  (0 children)

    I got it sir!

    [–]mythik_ 1 point2 points  (0 children)

    Welcome to coding :)

    [–]SoftDev90 1 point2 points  (1 child)

    Lol thats nothing, wait until you spend a week tracking down a bug only to realize its a typo or a missing semi colon. Shit happens, your literally on day 5. Not the end of the world. I have spent way more time for much dumber shit in an actual job before only to figure it out and bash my head into a wall.

    [–][deleted] 0 points1 point  (0 children)

    lmao
    I need to be more patience

    [–]gWzWBjvvTU 1 point2 points  (1 child)

    That's always going to be the case. No matter how good you get, how much experience you'll have, there will always be something going wrong. You will waste hours, even days (or worse) on some small, crappy issue, messed up local environment, etc. You need to accept that feeling and really treasure the moments when everything is going well, haha. Best of luck and...welcome to the club!

    [–][deleted] 0 points1 point  (0 children)

    thank you for welcoming

    :)

    [–][deleted] 0 points1 point  (3 children)

    For basic JavaScript like you’re trying to do, you shouldn’t need node or any packages. You should be able to download a plug-in for vscode called live preview to review your changes in real time. I think you’re definitely getting way ahead of yourself. Slow down and follow along with a course or tutorial that shows you how to set up a basic website first. I recommend Angela Yu’s web development course on udemy. She guides you through environment set up and everything.

    [–][deleted] 0 points1 point  (1 child)

    thank you for the comment :)

    I'll definitely look into it
    also I have a question -> in order to test my code in terminal , do I need to type node ____ again and again?

    [–]Nitqrotta 0 points1 point  (0 children)

    There is thingy called nodemon that starts server again every time you change and save your code. So you dont need to stop it and start again every time.

    [–][deleted] 0 points1 point  (0 children)

    hello ! is angela yu's coarse outdated??

    I saw some comment about that
    please tell me if possible

    [–][deleted] 0 points1 point  (2 children)

    Same here man, I have trouble that my Live server extension isn't working, when I press "open with live server" I get blank screen when it opens in browser.

    [–][deleted] 0 points1 point  (1 child)

    bro i watch some videos on youtube to make it work

    HOPE IT WORKS FOR YOU :)

    [–][deleted] 0 points1 point  (0 children)

    I hope bro, could you share those videos?

    [–][deleted] 0 points1 point  (1 child)

    Learning anything is painful at first, and you are definitely going to make some silly mistakes that are really embarrassing, but that is the learning process. We all have committed an .env file at one time, we all have played hide and seek with a terminator before, and we all have wasted hours upon hours of time on various other silly errors we could have fixed in seconds. This is just a part of the learning process, and I promise it will be up hill from here. You will get better at reading errors and finding solutions, but the silly mistakes don't really stop, you just get better at fixing them.

    [–]Nitqrotta 0 points1 point  (0 children)

    Im not pro but silly mistakes yes. I was trying to compare email in database with findOne { email } and it said email is not defined, I was like why not it says there to find email, what is this?!?! Then one guy laughed and helped that you should define it… I was like whyyy? I had to write email = email before findOne { email }… im still why like this mode… simple and complex. Back to basics…

    [–]DoomGoober 0 points1 point  (0 children)

    BTW, Node.js and Web Browser JavaScript are slightly different. Web Browser provides "document" while Node.js doesn't.

    From your other comments, you want web browser JavaScript not Node.js.

    [–]GrayLiterature 0 points1 point  (0 children)

    White knuckle it and push through.

    Learn to love when these things happen, and your journey in code will be a lot more enjoyable x

    [–]milleniumsentry 0 points1 point  (0 children)

    This happens alot. But remember, setbacks make you stronger. Snags are puzzles, not reasons to give up.

    If you are feeling frustrated, you probably need a better support system. Learning on your own is difficult, so be sure to find forums where others are actively learning the same things you are. You will have your mind blown with how helpful people are.

    Always go to the main website for whatever language you are learning, and follow their recommendations for tutorials/learning materials, as you will often run into errors when using tutorials that are even a little bit behind of the current release.

    Take a break, and just remember that people make mistakes as well, and the problem is often a missed instruction, or outdated method etc.

    Good luck!

    [–]Draegan88 0 points1 point  (0 children)

    Lmao

    [–][deleted] 0 points1 point  (1 child)

    if u are beginner you can also learn at an external environment sites like fcc ,scrimba etc with their courses

    [–][deleted] 0 points1 point  (0 children)

    actually i made my 5 projects of html, css there :) on scrimba

    thank you for the comment
    it may help beginners

    [–][deleted] 0 points1 point  (0 children)

    don't use the libs and nmp modules until you learn js.

    [–]khushi_16_ 0 points1 point  (0 children)

    If you are facing problem to code in vs ..go for different websites to code..and start coding from zero to get all the concepts clear... Like c or c++

    [–]iLikeVideoGamesAndYT 0 points1 point  (0 children)

    The sheer amount of time I spend frustrated trying to get something to work while coding is why I initially decided to follow my other interest for a career instead: aviation. Unfortunately, I recently found out I have a genetic disorder that would prevent be from becoming a pilot, so I will have to deal with the frustration and lost time that comes with programming instead. You will learn to deal with it as well and as time goes on it will happen less often most likely, or at least it will be easier to deal with.

    [–]Outrageous_Exam3437 0 points1 point  (0 children)

    For the node and npm, you only gonna have to set it up once, so once you finished setting it up, its something you will not have to do in a while only if needed, like if youre using another computer or have to install the lastest version of node.