React – Setting up Visual Studio Code to run react

  1. Install Node.js
    Go to https://nodejs.org.
  2. Click on ‘other downloads’

3. I’m on windows so I’m clicking here (it automatically knows my machine is 64bit)

4. Once installed, open PowerShell on windows (as administrator)

npm – v (shows which version of npm is running)

node – v (shows which version of node is running)

To run node: type

node

Ctrl+X or typing .exit will close node.js

Setup React in Visual Studio Code

Once the above steps are done, in Visual Studio Code, open the terminal.

Ensure you’re in the project folder that you want to create your React app in.

By typing ‘ls’ in the terminal this will show you the current directory. We can see we are in our project folder.

To create the react app within the current folder type

>npx create-react-app .

If you want to create a new react folder, e.g. “new-app” type the following. This will create a folder new-app within the folder previously selected.

>npx create-react-app new-app

Leave a Reply