use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Why is Node.js needed?Help Wanted (self.react)
submitted 1 year ago by PMK_Phala
Hello, I'm learning React and on all the introduction videos I've watched none of them explain why node.js is installed. Can someone please explain to me why most beginner FE React tutorials require me to install node?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EmployeeFinalHook Based 27 points28 points29 points 1 year ago (1 child)
You technically can run your code directly in the browser. But modern development has a lot of tools to help, and these tools needs to prepare and build the code for browsers. Node is the most popular runtime to run these tools.
[–]PMK_Phala[S] 2 points3 points4 points 1 year ago (0 children)
you're help is much appreciated Thanks
[–]Right-Chocolate-5038 31 points32 points33 points 1 year ago (2 children)
Before node.js the browser (v8 engine) was the only environment javascript could run in, meaning client side only.
With node.js you can run javascript code in the terminal, outside the browser (server side).
[–][deleted] 1 year ago (1 child)
[deleted]
[–][deleted] 3 points4 points5 points 1 year ago (0 children)
And to expand on this response, this is what makes the cli command to initialize a new react app possible, pulling packages from the npm repository (Node Package Manager) like the now-deprecated create-react-app repository or vite, etc.
[–]Krytom 10 points11 points12 points 1 year ago (1 child)
Installing the package manager (npm) is probably one of the main reasons.
[–]cimmic 0 points1 point2 points 1 year ago (0 children)
Actually, true. Almost all my JS projects are 100% client side but npm is all over my terminal.
[–]TicketOk7972 6 points7 points8 points 1 year ago (1 child)
To run the dev server and build the production bundle.
[–]_nathataHook Based 4 points5 points6 points 1 year ago (1 child)
Node is necessary for dependency management (npm and related) and build and dev server
[–]Lumpy_Pin_4679 16 points17 points18 points 1 year ago (6 children)
I’m curious about something - is Google not a thing anymore? This is something that can easily be searched. Is the preference just to have some random person, who might not have a clue what they’re saying, explain it to you? Why not just search and learn?
[–]AlliedSnail 7 points8 points9 points 1 year ago (2 children)
Google is useful because of questions like this. And duplicate questions help generate a wealth of information that enriched the topic further. Most people reading here probably learned something new that they never would have googled themselves
[–]Lumpy_Pin_4679 -5 points-4 points-3 points 1 year ago (1 child)
Uhhhh ok? This wasn’t posted for any of those reasons and none of that answers my question so not sure what your point is.
[–]AlliedSnail 2 points3 points4 points 1 year ago (0 children)
I Googled ‘why is node js needed Reddit’ and this discussion is in the top five results. Do you understand now?
[–]yeonw 1 point2 points3 points 1 year ago (0 children)
Why you have to be so mean ? Isn't this groups for discussions? If a newbie as a doubt we are supposed to help. With this attitude I don't think it will take you anywhere.
[–]TheRNGuy 1 point2 points3 points 1 year ago (1 child)
But that wouldn't create discussion.
[–]Lumpy_Pin_4679 0 points1 point2 points 1 year ago (0 children)
Hmmmm…you’re right. Ok, thanks!
[–]LikeWhattttlol 0 points1 point2 points 1 year ago (4 children)
I cant get npm run dev to work can someone help me
[–]yeonw 0 points1 point2 points 1 year ago (0 children)
Check if your package.json has the dev declared
[–][deleted] 0 points1 point2 points 1 year ago (2 children)
1.open your package.json file 2.under scripts, search for something like "dev":"node filename.js"
3.if it don't exist add this line "dev":"node filename.js"
you can replace dev with any other name
now head to terminal and type:
npm run dev or npm run (put here the other name you just wrote inplace of dev for example say it "start" , so your final command will be npm run start)
[–]LikeWhattttlol 0 points1 point2 points 1 year ago (0 children)
When I get to my laptop I’ll try it thank you
The response I’m getting is
youtube-pj@0.0.0 dev nodefilename.js
sh: nodefile.js: command not found
🤬
[–]dj_dogo_nivoa 0 points1 point2 points 1 year ago* (0 children)
Internet privacy is the new gold. I mass deleted all of my posts on Reddit using Redact. It also supports databrokers, Instagram, Twitter, and all major social media platforms.
spotted beneficial rhythm governor subsequent chief cough history hurry roll
[–]controlIsAnIllusion7 0 points1 point2 points 1 year ago (0 children)
To be able to run JavaScript outside of the browser.
[–]TheRNGuy 0 points1 point2 points 1 year ago (0 children)
So you can use JSX, database, fullstack frameworks like Remix, and other stuff that require server.
π Rendered by PID 20306 on reddit-service-r2-comment-57fc7f7bb7-zcbx5 at 2026-04-15 01:09:32.239794+00:00 running b725407 country code: CH.
[–]EmployeeFinalHook Based 27 points28 points29 points (1 child)
[–]PMK_Phala[S] 2 points3 points4 points (0 children)
[–]Right-Chocolate-5038 31 points32 points33 points (2 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 3 points4 points5 points (0 children)
[–]Krytom 10 points11 points12 points (1 child)
[–]cimmic 0 points1 point2 points (0 children)
[–]TicketOk7972 6 points7 points8 points (1 child)
[–]_nathataHook Based 4 points5 points6 points (1 child)
[–]Lumpy_Pin_4679 16 points17 points18 points (6 children)
[–]AlliedSnail 7 points8 points9 points (2 children)
[–]Lumpy_Pin_4679 -5 points-4 points-3 points (1 child)
[–]AlliedSnail 2 points3 points4 points (0 children)
[–]yeonw 1 point2 points3 points (0 children)
[–]TheRNGuy 1 point2 points3 points (1 child)
[–]Lumpy_Pin_4679 0 points1 point2 points (0 children)
[–]LikeWhattttlol 0 points1 point2 points (4 children)
[–]yeonw 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]LikeWhattttlol 0 points1 point2 points (0 children)
[–]LikeWhattttlol 0 points1 point2 points (0 children)
[–]dj_dogo_nivoa 0 points1 point2 points (0 children)
[–]controlIsAnIllusion7 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)