Prepare the environment

更新时间:
复制 MD 格式

Before developing a custom component, configure a development environment and initialize a project.

Step 1: Install the Node.js runtime environment

Install Node.js 8.9 LTS or later: Select a version to download.

Step 2: Install the npm package management tool

Internal beta users must use bnpm. After the public release, the project will migrate to the aliplus registry source, allowing you to use npm.

  1. Open the CMD command window and run the npm login command to log in.

    Note

    Visit bone.aliyun.com/profile to get your username and password.

    npm login --registry https://registry-node.aliyun.com/org/YscSvypAq7EUU~8GmyAjOp/registry/aliyunIoT/
  2. Contact technical support, provide your username, and follow the instructions to enable installation permissions.

  3. Run the following command to install the new version of bnpm.

    npm i -g @bone/npm --registry https://registry-node.aliyun.com/org/YscSvypAq7EUU~8GmyAjOp/registry/aliyunIoT/

Step 3: Initialize the project locally

  1. Open the CMD command window and run the bnpm login command to log in.

    Note

    Visit bone.aliyun.com/profile to get your username and password.

    bnpm login --registry https://registry-node.aliyun.com/org/YscSvypAq7EUU~8GmyAjOp/registry/aliyunIoT/
  2. Run the bnpm install command to install material-cli.

    bnpm install -g @maliang/material-cli
  3. Run material create <project_name> to create a project folder (for example, Demo) on your local computer.

    material create Demo
  4. After navigating to the project folder created in the previous step, run the bnpm install command to install the necessary dependencies.

    cd Demo
    bnpm install
  5. Run the npm run start command. Your browser automatically opens and displays the initial state of the component. You can use this page to test your component during development.

    The initial configuration of the component is as follows: the page is divided into two areas. The left area is the component preview area, which shows the runtime effect of the component (including an input box and a Reset button). The right area is the property configuration panel, which contains the Style and Interaction tabs for adjusting component properties such as coordinates, size, visibility, and opacity.

Next steps

Develop and test locally.