Search code examples
node.jsreactjsnpmcreate-react-app

How to use Create react app to install React


Hi I'm really new to react and I can't figure out how to actually install it or whatever it is I need to do to write code in it. I downloaded node.js and I have v12.18.3 installed as well as NPM 6.14.6 installed as well, but every time I try to type in the commands in the create-react-app installation method mentioned on many websites I get an error message saying: Uncaught SyntaxError: Invalid or unexpected token. Am I supposed to be typing directly into node? I have Visual code studio installed am I supposed to use that in some way? I see there’s a github repository for create-react-app, does this mean I have to download it to my pc to run it? Does React just have a CDN I can use to skip all this?


Solution

  • create-react-app is the command to create the react app. But it is not necessary to install it to create-react-app.

    Best thing you have to do is,

    npx create-react-app <app-name-here>
    

    This makes install create-react-app install in the runtime of the command with using npx.

    As an example,

    npx create-react-app my_app
    

    Try this. Best regards.