English
English
简体中文
Contact Us
Register
Log In

Build Development Environment

Last Updated on : 2022-09-13 05:50:45download

This topic describes how to build the environments required by panel development.

Install development tools

Before you develop an SDK-based panel, download and install the following recommended editors as needed:

  • Visual Studio Code (recommended): supports common built-in features, such as formatting and navigation. This editor is subject to a high level of community engagement.
  • WebStorm: a high-performance integrated development environment (IDE).
  • Sublime Text: a lightweight editor.
  • Atom: a lightweight editor.

Install NVM

If this is your first installation, set up the environment variable as per the instruction.

  1. Open the Terminal.

  2. Install the NVM.

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
    
  3. (Optional) Enter nvm -v to confirm that the NVM is installed as expected.

    If a version number is returned, the installation is successful. If the error is returned: nvm: command not found, follow the instructions in FAQs to fix the error.

  4. Enter nvm install 10.15.0 to install Node.js v10.15.0.

    We recommend that you install Node.js v10.15.0 or later.

  5. (Optional) Run the command nvm use to switch among Node.js versions.

    nvm use 10.15.0   
    

Install Yarn

  1. Open the Terminal.

  2. Enter npm install -g yarn to install Yarn.

  3. (Optional) Enter yarn -v to confirm that Yarn is installed as expected.

Install Homebrew and watchman

This section applies to macOS only.

  1. Open the Terminal.

  2. Run the following command to install Homebrew.

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  3. Enter brew install watchman to install watchman.

FAQs

Q: After nvm -v is entered, why has the error been returned: nvm: command not found?

A: The possible reason is that the path where NVM is located is not specified as an environment variable. You can perform the following steps and set the environment variable:

  1. Open the Terminal.

  2. Enter cd ~ to go to the Home directory of the current account.

  3. Run the following command to open the configuration file.

    • Windows

      open .bash_profile
      
    • Latest version of macOS

      open .zshrc
      
  4. Copy and paste the following code block to the configuration file and save the file.

    export NVM_DIR="$HOME/.nvm"
     [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
    
  5. Enter source .bash_profile or source .zshrc to reload the configuration file.

  6. Enter nvm -v to view the NVM version and check whether the installation is successful.

Q: Homebrew could not be installed on macOS. How can I fix the problem?

A: If you have not installed Xcode command-line tools on your computer, the installation of Homebrew might fail.

  • Method 1: Install Xcode.

  • Method 2: Run the online installation command to install Homebrew.

    1. Open the macOS Terminal.
    2. Enter cd ~ to go to the Home directory of the current account.
    3. Enter xcode-select --install to install Xcode command-line tools.

References

During the installation or running of React Native (RN), if an error message appears, you can check the troubleshooting document from the RN community.