DEV Community

Derrick TheCodeholic
Derrick TheCodeholic

Posted on

Deploying a react app in netlify

Netlify CLI
Netifly also provides a command line interface that lets you deploy your app straight from the command line. That’s what we will do now.

So first, we’ll install the CLI using the following command:

npm install netlify-cli -g
Enter fullscreen mode Exit fullscreen mode

Now, we’re ready to deploy it. To deploy the application we have to make sure that we’re in the project folder and then we will run this command:

netlify deploy
Enter fullscreen mode Exit fullscreen mode

We might get a pop-up window which will ask us to log in with Netlify and grant access to the Netlify CLI, click Authorize. Now that we’re authorized, we can follow the command line prompts to deploy the app.
Command Line Prompts

  1. In the console, it says that** “This folder isn’t linked to a site yet. What would you like to do?”** It wants to know if we want to link this directory to an existing site or create and configure a new site. Since this is a new site, we’ll select Create & configure a new site.
  2. It gives us the option to give our site a name. I’ll type TheCodeholic (You can type any available name which you like).
  3. Now it will ask for the Netlify account which you want to use, so I will select my account (deliicmugambi's teami ), you can select yours.
  4. Now, as deploy path, we need to specify our project's build directory which contains the assets for deployment. So, we will type build there and press enter.

Top comments (0)