This topic describes how to install Cloud Development Toolkit (CDK) of Resource Orchestration Service (ROS) on Linux, Windows, and macOS.
Prerequisites
Node.js and TypeScript of the following versions are available:
Node.js: V14.17.0 or later
TypeScript: V3.8 or later
Install ROS CDK on Linux
The following section provides an example on how to install ROS CDK on 64-bit CentOS 8.2.
Run the following commands to install Node.js, npm, TypeScript, and Lerna:
# ROS CDK is developed by using TypeScript. Therefore, you must install the relevant software packages. sudo yum install -y nodejs npm sudo npm install typescript -g sudo npm install lerna -g
NoteIf Node.js that is installed by running the preceding commands is not of V14.17.0 or later, you can go to the Node.js official website to download the required version.
Run the following command to install ROS CDK CLI:
sudo npm install @alicloud/ros-cdk-cli -g
Run the following command to query the features that are supported by ROS CDK:
sudo ros-cdk
After you run the command, the following output is returned:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.
Install ROS CDK on Windows
The following section provides an example on how to install ROS CDK on 64-bit Windows 2016.
Install Node.js.
Download the installation package from the Node.js official website.
Follow on-screen instructions to install Node.js.
Run the following command in the command prompt window to check the version of Node.js:
node --version v14.17.0
Run the following commands to install TypeScript and Lerna:
# ROS CDK is developed by using TypeScript. Therefore, you must install the relevant software packages. npm install typescript -g npm install lerna -g
Run the following command to install ROS CDK CLI:
npm install @alicloud/ros-cdk-cli -g
Run the following command to query the features that are supported by ROS CDK:
ros-cdk
After you run the command, the following output is returned:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.
Install ROS CDK on macOS
The following section provides an example on how to install ROS CDK on 64-bit macOS 11.2.2.
Run the following commands to install Homebrew, Node.js, npm, TypeScript, and Lerna:
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" brew install node npm install -g typescript npm install -g lerna
NoteIf Node.js that is installed by running the preceding commands is not of V14.17.0 or later, you can go to the Node.js official website to download the required version.
Run the following command to install ROS CDK CLI:
sudo npm install @alicloud/ros-cdk-cli -g
Run the following command to query the features that are supported by ROS CDK:
sudo ros-cdk
After you run the command, the following output is returned:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.