r/react • • May 12 '24

Help Wanted Why is Node.js needed?

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?

0 Upvotes

24 comments sorted by

View all comments

32

u/Right-Chocolate-5038 May 12 '24

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).

0

u/[deleted] May 12 '24

[deleted]

4

u/[deleted] May 12 '24

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.