Setting Up a React Development Environment

Last updated : April 15, 2023

In this article, I will explain the process of setting up a React development environment. That includes installing Node.js and npm to create a new React project with Create React App. I will also discuss some popular code editors and IDEs that you can use for React development.

1. Install Node Js and NPM

Before starting with React, I need Node.js and npm (Node Package Manager) installed on my system. Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine, while npm is the default package manager for Node.js.

Follow these steps to install Node js and npm package manager.

  1. Visit the official Node.js website at
  2. Download the recommended LTS (Long Term Support) version for your OS.
  3. Run the installer and follow the prompts to complete the installation process.
  4. Once the installation is complete, open a terminal or command prompt and run the following commands to check if Node.js and npm are installed correctly:
    node --version
    npm --version

If the commands return version numbers, then Node.js and npm are installed successfully.

2. Create React App

Create React App is a tool created by Facebook to set up a new React project with a minimal default configuration quickly. It automates the process of setting up a React application, including the build process, development server, and folder structure.

Here are the steps to run the Create React App command.

  1. Open a terminal or command prompt and run the following command to install Create React App globally. If you don't want it installed globally, run the command without -g.
    npm install -g create-react-app
    That installs the create-react-app tool on your system.
  2. Once the installation is complete, I can create a new React project by running the following command.
    create-react-app my-react-website
  3. Navigate to the newly created project directory by running:
    cd my-app
  4. Start the development server by running the following:
    npm start
    This command will open a new browser window. I also can manually navigate to the app running at http://localhost:3000/.

3. Code editors and IDEs (Integrated Development Environments)

Choosing the right code editor or IDE can significantly improve productivity and overall development experience. Here are some popular options for React development.

  1. Visual Studio Code (VSCode): A lightweight and powerful code editor developed by Microsoft. It supports a wide range of languages and has excellent support for JavaScript and React Js development through extensions. Some recommended extensions for React development include ESLint, Prettier, and Bracket Pair Colorizer.
    Download Visual Studio Code at
  2. Sublime Text: A popular text editor with a large community and extensive plugin support. You can enhance your React development experience by installing plugins like Babel, SublimeLinter, and SublimeLinter-eslint.
    Download Sublime Text at
  3. WebStorm: A powerful and fully-featured IDE for JavaScript development developed by JetBrains. WebStorm provides built-in support for React development, including intelligent code completion, syntax highlighting, and debugging tools.
    Download WebStorm at

Errors during the installation process

While installing Node.js and npm, users might encounter some common issues. Here are a few of them with potential solutions. Deleting the node_modules folder after applying any fix is a good idea.

  1. Permission issues:
    Sometimes, users face permission issues during installation or while running npm commands. That is more common on Linux and macOS systems.
    Solution: You can try to run the npm command with sudo to grant administrative privileges.
    sudo npm install -g package-name
    You also can change the default directory for global packages. Using a Node version manager like n or nvm that manages multiple Node.js versions is also an option to avoid permission issues.
  2. Outdated Node.js or npm versions:
    If you use an older version of Node.js or npm, you might face compatibility issues with certain packages or commands.
    Solution: Update Node.js and npm to the latest versions. You can download the latest version of Node.js from the official website Alternatively, you can use a Node version manager like n or nvm to easily switch between different versions.
  3. Proxy or firewall restrictions:
    Network restrictions might sometimes prevent you from downloading Node.js, installing npm packages, or connecting to the npm registry. That is more common in office/corporate environments.
    Solution: Configure your npm client to work with your proxy or firewall settings. You can set the proxy and HTTPS proxy settings using the following commands:
    npm config set proxy
    npm config set https-proxy
  4. Incomplete or corrupted installation:
    If the Node.js installation was interrupted or some files were corrupted during the process, you might experience issues using Node.js and npm.
    Solution: Uninstall Node.js completely, clear the npm cache, and then reinstall Node.js from the official website.
    npm cache clean --force
  5. Conflicting npm packages or incorrect package versions:
    Sometimes, npm packages might conflict or be incompatible with your Node.js version.
    Solution: Check the package documentation for compatibility information, and make sure you are using the correct versions of your packages. If necessary, update or downgrade the packages to compatible versions. Deleting the node_modules folder and package-lock.json may also help resolve this issue.
L Raney
By: L Raney
Lance is a software engineer with over 15 years of experience in full-stack software development.

Comments are disabled

No Comments