Why we have to install NodeJS for ReactJS












0















I'm a beginner in ReactJS also for NodeJS. I would love to know why we have to install NodeJS run ReactJS application as ReactJS is client-side scripting.










share|improve this question




















  • 1





    Indeed you need npm for package management in React. And npm generally requires NodeJs. If you can find a way to install it on its own, you would not explicitly need NodeJs.

    – vahdet
    Nov 14 '18 at 8:15











  • Related stackoverflow.com/questions/26398537/… .

    – kabanus
    Nov 14 '18 at 8:15
















0















I'm a beginner in ReactJS also for NodeJS. I would love to know why we have to install NodeJS run ReactJS application as ReactJS is client-side scripting.










share|improve this question




















  • 1





    Indeed you need npm for package management in React. And npm generally requires NodeJs. If you can find a way to install it on its own, you would not explicitly need NodeJs.

    – vahdet
    Nov 14 '18 at 8:15











  • Related stackoverflow.com/questions/26398537/… .

    – kabanus
    Nov 14 '18 at 8:15














0












0








0








I'm a beginner in ReactJS also for NodeJS. I would love to know why we have to install NodeJS run ReactJS application as ReactJS is client-side scripting.










share|improve this question
















I'm a beginner in ReactJS also for NodeJS. I would love to know why we have to install NodeJS run ReactJS application as ReactJS is client-side scripting.







node.js reactjs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 8:32









Nguyễn Thanh Tú

4,7143827




4,7143827










asked Nov 14 '18 at 8:13









yudiyudi

113




113








  • 1





    Indeed you need npm for package management in React. And npm generally requires NodeJs. If you can find a way to install it on its own, you would not explicitly need NodeJs.

    – vahdet
    Nov 14 '18 at 8:15











  • Related stackoverflow.com/questions/26398537/… .

    – kabanus
    Nov 14 '18 at 8:15














  • 1





    Indeed you need npm for package management in React. And npm generally requires NodeJs. If you can find a way to install it on its own, you would not explicitly need NodeJs.

    – vahdet
    Nov 14 '18 at 8:15











  • Related stackoverflow.com/questions/26398537/… .

    – kabanus
    Nov 14 '18 at 8:15








1




1





Indeed you need npm for package management in React. And npm generally requires NodeJs. If you can find a way to install it on its own, you would not explicitly need NodeJs.

– vahdet
Nov 14 '18 at 8:15





Indeed you need npm for package management in React. And npm generally requires NodeJs. If you can find a way to install it on its own, you would not explicitly need NodeJs.

– vahdet
Nov 14 '18 at 8:15













Related stackoverflow.com/questions/26398537/… .

– kabanus
Nov 14 '18 at 8:15





Related stackoverflow.com/questions/26398537/… .

– kabanus
Nov 14 '18 at 8:15












2 Answers
2






active

oldest

votes


















3














The other answer is incorrect.
You don't NEED Node.js, in fact you could create a project without running a single npm command. Just follow this guide.



The main reason, as pointed out in the article, is:




  1. Easy package management. This means you can upgrade the package easily later on

  2. JSX is the templating language that makes it way easier to write components: <h1>Hello Word</h1> reads so much better than React.createElement('h1', null, 'Hello World')

  3. Managing module imports, as opposed to having global variables around everywhere, it's great to have encapsulation and import modules as needed.

  4. Build step and workflow. For a modern project, you will need tools to minify your code, cache busting, transpiling (writing pure javascript for old browser is a pain and you really shouldn't do it manually), the list goes on and on.






share|improve this answer


























  • Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

    – m__
    Nov 14 '18 at 9:18











  • I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

    – Jonny Lin
    Nov 14 '18 at 19:04











  • Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

    – m__
    Nov 14 '18 at 19:36











  • @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

    – yudi
    Nov 18 '18 at 6:47



















0














Because almost all the JavaScript libraries/frameworks are using the Node Package Manager (NPM), that makes much more convenient to manage JavaScript dependencies in general, both client-side and server-side.



Edit: It's not really technically necessary, but using a package manager is the best practice for managing dependencies and sub-dependencies.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53295618%2fwhy-we-have-to-install-nodejs-for-reactjs%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The other answer is incorrect.
    You don't NEED Node.js, in fact you could create a project without running a single npm command. Just follow this guide.



    The main reason, as pointed out in the article, is:




    1. Easy package management. This means you can upgrade the package easily later on

    2. JSX is the templating language that makes it way easier to write components: <h1>Hello Word</h1> reads so much better than React.createElement('h1', null, 'Hello World')

    3. Managing module imports, as opposed to having global variables around everywhere, it's great to have encapsulation and import modules as needed.

    4. Build step and workflow. For a modern project, you will need tools to minify your code, cache busting, transpiling (writing pure javascript for old browser is a pain and you really shouldn't do it manually), the list goes on and on.






    share|improve this answer


























    • Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

      – m__
      Nov 14 '18 at 9:18











    • I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

      – Jonny Lin
      Nov 14 '18 at 19:04











    • Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

      – m__
      Nov 14 '18 at 19:36











    • @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

      – yudi
      Nov 18 '18 at 6:47
















    3














    The other answer is incorrect.
    You don't NEED Node.js, in fact you could create a project without running a single npm command. Just follow this guide.



    The main reason, as pointed out in the article, is:




    1. Easy package management. This means you can upgrade the package easily later on

    2. JSX is the templating language that makes it way easier to write components: <h1>Hello Word</h1> reads so much better than React.createElement('h1', null, 'Hello World')

    3. Managing module imports, as opposed to having global variables around everywhere, it's great to have encapsulation and import modules as needed.

    4. Build step and workflow. For a modern project, you will need tools to minify your code, cache busting, transpiling (writing pure javascript for old browser is a pain and you really shouldn't do it manually), the list goes on and on.






    share|improve this answer


























    • Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

      – m__
      Nov 14 '18 at 9:18











    • I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

      – Jonny Lin
      Nov 14 '18 at 19:04











    • Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

      – m__
      Nov 14 '18 at 19:36











    • @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

      – yudi
      Nov 18 '18 at 6:47














    3












    3








    3







    The other answer is incorrect.
    You don't NEED Node.js, in fact you could create a project without running a single npm command. Just follow this guide.



    The main reason, as pointed out in the article, is:




    1. Easy package management. This means you can upgrade the package easily later on

    2. JSX is the templating language that makes it way easier to write components: <h1>Hello Word</h1> reads so much better than React.createElement('h1', null, 'Hello World')

    3. Managing module imports, as opposed to having global variables around everywhere, it's great to have encapsulation and import modules as needed.

    4. Build step and workflow. For a modern project, you will need tools to minify your code, cache busting, transpiling (writing pure javascript for old browser is a pain and you really shouldn't do it manually), the list goes on and on.






    share|improve this answer















    The other answer is incorrect.
    You don't NEED Node.js, in fact you could create a project without running a single npm command. Just follow this guide.



    The main reason, as pointed out in the article, is:




    1. Easy package management. This means you can upgrade the package easily later on

    2. JSX is the templating language that makes it way easier to write components: <h1>Hello Word</h1> reads so much better than React.createElement('h1', null, 'Hello World')

    3. Managing module imports, as opposed to having global variables around everywhere, it's great to have encapsulation and import modules as needed.

    4. Build step and workflow. For a modern project, you will need tools to minify your code, cache busting, transpiling (writing pure javascript for old browser is a pain and you really shouldn't do it manually), the list goes on and on.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 14 '18 at 10:01









    t3__rry

    1,8171126




    1,8171126










    answered Nov 14 '18 at 8:24









    Jonny LinJonny Lin

    600210




    600210













    • Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

      – m__
      Nov 14 '18 at 9:18











    • I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

      – Jonny Lin
      Nov 14 '18 at 19:04











    • Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

      – m__
      Nov 14 '18 at 19:36











    • @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

      – yudi
      Nov 18 '18 at 6:47



















    • Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

      – m__
      Nov 14 '18 at 9:18











    • I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

      – Jonny Lin
      Nov 14 '18 at 19:04











    • Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

      – m__
      Nov 14 '18 at 19:36











    • @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

      – yudi
      Nov 18 '18 at 6:47

















    Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

    – m__
    Nov 14 '18 at 9:18





    Okay, it's not technically mandatory, but why shouldn't you use a package manager to manage dependencies? It totally makes no sense

    – m__
    Nov 14 '18 at 9:18













    I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

    – Jonny Lin
    Nov 14 '18 at 19:04





    I'm heavily reliant on node, but I can see how small projects could benefit from using just a few lines of script tag to pull libraries from CDN as opposed to a full on project

    – Jonny Lin
    Nov 14 '18 at 19:04













    Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

    – m__
    Nov 14 '18 at 19:36





    Even in small applications dependencies are hardly less than a couple, using a standard to define and manage them universally can always be convenient for many reasons. But of course this can be only an opinion, and of course you can also simply link them from a CDN

    – m__
    Nov 14 '18 at 19:36













    @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

    – yudi
    Nov 18 '18 at 6:47





    @JonnyLin, thank you so much for explanation on query. marking it as accepted answer. Hope to see you next time.

    – yudi
    Nov 18 '18 at 6:47













    0














    Because almost all the JavaScript libraries/frameworks are using the Node Package Manager (NPM), that makes much more convenient to manage JavaScript dependencies in general, both client-side and server-side.



    Edit: It's not really technically necessary, but using a package manager is the best practice for managing dependencies and sub-dependencies.






    share|improve this answer






























      0














      Because almost all the JavaScript libraries/frameworks are using the Node Package Manager (NPM), that makes much more convenient to manage JavaScript dependencies in general, both client-side and server-side.



      Edit: It's not really technically necessary, but using a package manager is the best practice for managing dependencies and sub-dependencies.






      share|improve this answer




























        0












        0








        0







        Because almost all the JavaScript libraries/frameworks are using the Node Package Manager (NPM), that makes much more convenient to manage JavaScript dependencies in general, both client-side and server-side.



        Edit: It's not really technically necessary, but using a package manager is the best practice for managing dependencies and sub-dependencies.






        share|improve this answer















        Because almost all the JavaScript libraries/frameworks are using the Node Package Manager (NPM), that makes much more convenient to manage JavaScript dependencies in general, both client-side and server-side.



        Edit: It's not really technically necessary, but using a package manager is the best practice for managing dependencies and sub-dependencies.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 14 '18 at 9:25

























        answered Nov 14 '18 at 8:14









        m__m__

        598315




        598315






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53295618%2fwhy-we-have-to-install-nodejs-for-reactjs%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine