May 27, 2021 Web Cloud Development and Web Hosting Learning Guide
1. Step 1: Make sure node and .js are installed
2. Step 2: Install the command line tool
Cloud Development Officially Provides Command Line Tools (CLI): . Y ou can use the CLI for cloud development resource control, function deployment, and more. Here's how to install it:
If you do not have a Node .js installed on your machine, it is recommended .js download a binary file from the Node.js website and install it directly, and we recommend that you select ltS version.
You can now use npm to install cloudbase/cli, open the command line terminal, and enter the following command:
sudo npm i -g @cloudbase/cli
If prompted to enter a password, enter your computer's power-on password. Sudo is used here to have permission to install globally.
If the installation process does not have an error prompt, the installation is generally successful. Let's move on to the command:
cloudbase -v
If you see the output version number, it has been installed successfully.
To simplify the input, the cloudbase command can be simply written as tcb. t cb is short for Tencent CloudBase for cloud development products. Here you can also learn more about 1 more command and try to enter to the command line terminal:
tcb -h
You can see all the capabilities and commands that the CLI currently supports. It is recommended that you use -h frequently to view commands.
? W hen using the CloudBase CLI, you need your terminal to be able to access the network. If your terminal does not have direct access to the public network, you can set up an HTTP proxy to enable the CLI to function
http_proxy
orHTTP_PROXY
environment variables and automatically set up the network proxy service.For example, you can run the following command in the terminal to set up
http://127.0.0.1:8000
through the proxy service http://127.0.0.1:8000 of the server:
export HTTP_PROXY=http://127.0.0.1:8000
The above command is only a temporary setting, when you close the terminal, the agent will automatically expire, the next time you open the terminal need to be reset. If you need to access the public network through an agent all the time, you can add commands to the terminal's configuration file.